path: root/src/widgets/styles
diff options
authorEirik Aavitsland <>2019-12-03 13:39:08 +0100
committerEirik Aavitsland <>2019-12-10 00:38:39 +0100
commit03dc30acca4976c716c723ff46d503d35459b2a0 (patch)
tree2a9b0ac3d14926d2d15a353488fc10d577bc1705 /src/widgets/styles
parentf16bd401896479ed984eb087758c19e9e551139f (diff)
Fix QPushButton style sheet style for overlay (content) image
Unlike comparable widgets like QLabel or QFrame, QPushButton would not render a content image specified in the stylesheet, unless a border style was also specified. Fix by explicitly rendering the content image, if set, in the native-border codepath also. Although the doc warns about the QPushButton border style having to be set in order for the background styling to take effect (since the native border painting otherwise hides it), the previous behavior does seem unexpected. Fixes: QTBUG-72029 Change-Id: I8b979b010515dab4dcf2f00344a187c87eeec096 Reviewed-by: Friedemann Kleint <> Reviewed-by: Christian Ehrlicher <>
Diffstat (limited to 'src/widgets/styles')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index aab4b74c4b..98c85684ae 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -3493,6 +3493,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
} else {
QWindowsStyle::drawControl(ce, &btnOpt, p, w);
+ rule.drawImage(p, rule.contentsRect(opt->rect));
if (!customMenu)
} else {