From 03dc30acca4976c716c723ff46d503d35459b2a0 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Tue, 3 Dec 2019 13:39:08 +0100 Subject: 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 --- src/widgets/styles/qstylesheetstyle.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets/styles') 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) return; } else { -- cgit v1.2.3