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 <jpnurmi@qt.io>
bb10
Friedemann Kleint 2017-04-04 10:32:06 +02:00
parent 22d43c9e51
commit 267c2c2a93
1 changed files with 3 additions and 2 deletions

View File

@ -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);