From 75c896f9b104831e40dfa6ca9aedebaa272704b5 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 30 Mar 2025 12:00:25 +0200 Subject: [PATCH] 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 --- src/plugins/styles/modernwindows/qwindows11style.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index 89d53c2b001..ac98aaa5900 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -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;