forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user