Windows11Style: Honor sort indicator size in headerview

The windows11 style, in contrast to the windows vista style, draws the
indicator on the side. Therefore call QWindowsStyle::sizeHint() for
CT_HeaderSection as the base style has the correct implementation.

Pick-to: 6.9 6.8
Fixes: QTBUG-135338
Change-Id: If84f72f9f26e87617ecebb1a01f448219d8656ba
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
This commit is contained in:
Christian Ehrlicher 2025-03-30 12:00:25 +02:00
parent 9e32306dae
commit 75c896f9b1

View File

@ -2142,6 +2142,11 @@ QSize QWindows11Style::sizeFromContents(ContentsType type, const QStyleOption *o
contentSize += QSize(8, 0); // arrow margins
}
break;
case CT_HeaderSection:
// windows vista does not honor the indicator (as it was drawn above the text, not on the
// side) so call QWindowsStyle::styleHint directly to get the correct size hint
contentSize = QWindowsStyle::sizeFromContents(type, option, size, widget);
break;
default:
contentSize = QWindowsVistaStyle::sizeFromContents(type, option, size, widget);
break;