aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2022-11-21 15:02:57 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2022-11-21 15:26:57 +0000
commitdfa5b546476d7b8fcb7792b9fc8bde6282b2b144 (patch)
tree0a9c51f3d86ddffe15a310a9f2eb77834e34fd5e
parent83ddbaad23c321d13244e5e00a0e16b85b0b0a82 (diff)
Utils: Fix StyleHelper::drawArrow workaround for 6.4.0v9.0.0
The workaround that fixed the drawing of arrows after a change between 6.4.0 and 6.4.1 broke the drawing of arrows with Qt 6.4.0. This change add another enforced detachment of the palette (leading to a modified cache key) that works with Qt 6.4.0. It still works with 6.4.1. Amends: 9d32093421adec260a8abc0920257564d45c12bf Change-Id: I8917c99488cec4fb17ed148bb3b0f95d4ed7127c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--src/libs/utils/stylehelper.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp
index ade12533db..b60a35c33f 100644
--- a/src/libs/utils/stylehelper.cpp
+++ b/src/libs/utils/stylehelper.cpp
@@ -306,9 +306,14 @@ void StyleHelper::drawArrow(QStyle::PrimitiveElement element, QPainter *painter,
static const QCommonStyle* const style = qobject_cast<QCommonStyle*>(QApplication::style());
if (!style)
return;
+
+ // Workaround for QTCREATORBUG-28470
QPalette pal = tweakedOption.palette;
+ pal.setBrush(QPalette::Base, pal.text()); // Base and Text differ, causing a detachment.
+ // Inspired by tst_QPalette::cacheKey()
pal.setColor(QPalette::ButtonText, color.rgb());
- tweakedOption.palette = pal; // Workaround for QTCREATORBUG-28470
+
+ tweakedOption.palette = pal;
tweakedOption.rect = rect;
painter.setOpacity(color.alphaF());
style->QCommonStyle::drawPrimitive(element, &tweakedOption, &painter);