QWindows11Style: Respect ItemViewItem foreground color

Fixes: QTBUG-126596
Fixes: QTBUG-126543
Pick-to: 6.7
Change-Id: I39803927259092be98dad02fa286bc92520ce43f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 7dc67d98976b7de7a34f74c9840d98aa5512d8dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Wladimir Leuschner 2024-06-24 14:53:29 +02:00 committed by Qt Cherry-pick Bot
parent da18a576a9
commit 41df8e68cb

View File

@ -1654,7 +1654,6 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op
painter->drawLine(QPointF(option->rect.topLeft()) - QPointF(0.5,0.0), painter->drawLine(QPointF(option->rect.topLeft()) - QPointF(0.5,0.0),
QPointF(option->rect.bottomLeft()) - QPointF(0.5,0.0)); QPointF(option->rect.bottomLeft()) - QPointF(0.5,0.0));
} }
painter->setPen(QPen(option->palette.buttonText().color()));
const bool isTreeView = qobject_cast<const QTreeView *>(widget); const bool isTreeView = qobject_cast<const QTreeView *>(widget);
@ -1712,7 +1711,7 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op
QIcon::State state = vopt->state & QStyle::State_Open ? QIcon::On : QIcon::Off; QIcon::State state = vopt->state & QStyle::State_Open ? QIcon::On : QIcon::Off;
vopt->icon.paint(painter, iconRect, vopt->decorationAlignment, mode, state); vopt->icon.paint(painter, iconRect, vopt->decorationAlignment, mode, state);
painter->setPen(QPen(option->palette.buttonText().color())); painter->setPen(QPen(option->palette.text().color()));
if (!view || !view->isPersistentEditorOpen(vopt->index)) if (!view || !view->isPersistentEditorOpen(vopt->index))
d->viewItemDrawText(painter, vopt, textRect); d->viewItemDrawText(painter, vopt, textRect);
if (vopt->state & State_Selected if (vopt->state & State_Selected