aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2022-11-18 14:27:51 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2022-11-18 16:27:46 +0000
commit9d32093421adec260a8abc0920257564d45c12bf (patch)
tree85120c44873c7805882deb078676005f4bed704a /src/libs
parentf5efd9acc09a62a22e53471816d5940a469c9346 (diff)
Utils: Workaround StyleHelper::drawArrow for Qt 6.4.1
A change in Qt 6.4.1 influences the behavior of QPalette::setColor, so that the arrows appear in a wrong color. An enforeced detachment of the palette in style option works as a workaround. Fixes: QTCREATORBUG-28470 Change-Id: I4a44ff59c368105fdf448152d83e96cdedd46495 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/utils/stylehelper.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp
index de1419a11f..ade12533db 100644
--- a/src/libs/utils/stylehelper.cpp
+++ b/src/libs/utils/stylehelper.cpp
@@ -306,7 +306,9 @@ void StyleHelper::drawArrow(QStyle::PrimitiveElement element, QPainter *painter,
static const QCommonStyle* const style = qobject_cast<QCommonStyle*>(QApplication::style());
if (!style)
return;
- tweakedOption.palette.setColor(QPalette::ButtonText, color.rgb());
+ QPalette pal = tweakedOption.palette;
+ pal.setColor(QPalette::ButtonText, color.rgb());
+ tweakedOption.palette = pal; // Workaround for QTCREATORBUG-28470
tweakedOption.rect = rect;
painter.setOpacity(color.alphaF());
style->QCommonStyle::drawPrimitive(element, &tweakedOption, &painter);