From 267c2c2a93eb3aa09b01f0fe383ee01a6fcdbec2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 4 Apr 2017 10:32:06 +0200 Subject: [PATCH] QFusionStyle::drawPrimitive(): Use color in cache key of PE_PanelButtonCommand Previously, only bool isDefault was used, which did not discriminate changes in ButtonColor. Use the color name instead. Task-number: QTBUG-59850 Change-Id: I1e006f98371a5f2039dcca1207addc0396e7c1e5 Reviewed-by: J-P Nurmi --- src/widgets/styles/qfusionstyle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 98d45587f0..19b1cc2c57 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -908,8 +908,6 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, return; } - BEGIN_STYLE_PIXMAPCACHE(QString::fromLatin1("pushbutton-%1").arg(isDefault)) - r = rect.adjusted(0, 1, -1, 0); bool isEnabled = option->state & State_Enabled; bool hasFocus = (option->state & State_HasFocus && option->state & State_KeyboardFocusChange); @@ -923,6 +921,9 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, if (isDefault) buttonColor = mergedColors(buttonColor, highlightedOutline.lighter(130), 90); + BEGIN_STYLE_PIXMAPCACHE(QStringLiteral("pushbutton-") + buttonColor.name(QColor::HexArgb)) + r = rect.adjusted(0, 1, -1, 0); + p->setRenderHint(QPainter::Antialiasing, true); p->translate(0.5, -0.5);