From 81b33a8252d8a69277782f51c9c7401c7009c72e Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 27 May 2019 14:35:18 +0200 Subject: Fusion: Fill the rect with base brush when drawing the combobox frame Instead of doing this directly inside the PE_FrameLineEdit as this can be used directly when a stylesheet is set the rect of the lineedit used in the combobox in fusion style is filled directly with the base brush. This ensures it still renders the background correctly when using fusion style, but enables stylesheets to work as it will not override that if the background is set in a stylesheet for a combobox. Fixes: QTBUG-75816 Change-Id: I50a0600b500088ebcf1d70a02f9c74c6040d34d9 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/styles/qfusionstyle.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/widgets/styles') diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index c565932889..64954dc833 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -2769,8 +2769,16 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption buttonOption.state &= ~State_MouseOver; } - if (comboBox->frame) + if (comboBox->frame) { + cachePainter.save(); + cachePainter.setRenderHint(QPainter::Antialiasing, true); + cachePainter.translate(0.5, 0.5); + cachePainter.setPen(Qt::NoPen); + cachePainter.setBrush(buttonOption.palette.base()); + cachePainter.drawRoundedRect(rect.adjusted(0, 0, -1, -1), 2, 2); + cachePainter.restore(); proxy()->drawPrimitive(PE_FrameLineEdit, &buttonOption, &cachePainter, widget); + } // Draw button clipped cachePainter.save(); -- cgit v1.2.3