Skip to content

Commit

Permalink
QWindows11Style: Fix sorting arrows in headers
Browse files Browse the repository at this point in the history
Fixes: QTBUG-126345
Change-Id: Ifb0bb46329a909fd113318f61ca37ba01f4d873d
Reviewed-by: Oliver Wolff <[email protected]>
(cherry picked from commit 8164247)
  • Loading branch information
Wladimir Leuschner committed Nov 6, 2024
1 parent cd48b78 commit 61c67cf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/plugins/styles/modernwindows/qwindows11style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,18 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
}
}
break;
case PE_IndicatorHeaderArrow:
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
painter->setPen(header->palette.text().color());
painter->setFont(assetFont);
QRectF rect = option->rect;
if (header->sortIndicator & QStyleOptionHeader::SortUp) {
painter->drawText(rect,Qt::AlignCenter,"\uE96D");
} else if (header->sortIndicator & QStyleOptionHeader::SortDown) {
painter->drawText(rect,Qt::AlignCenter,"\uE96E");
}
}
break;
case PE_IndicatorCheckBox:
{
QNumberStyleAnimation* animation = qobject_cast<QNumberStyleAnimation*>(d->animation(option->styleObject));
Expand Down Expand Up @@ -1812,6 +1824,10 @@ QRect QWindows11Style::subElementRect(QStyle::SubElement element, const QStyleOp
ret = QWindowsVistaStyle::subElementRect(element, option, widget);
}
break;
case QStyle::SE_HeaderLabel:
case QStyle::SE_HeaderArrow:
ret = QCommonStyle::subElementRect(element, option, widget);
break;
default:
ret = QWindowsVistaStyle::subElementRect(element, option, widget);
}
Expand Down

0 comments on commit 61c67cf

Please sign in to comment.