From a223eca4aecde508d8c2d50dc859612eda8f3dc1 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 21 Mar 2025 23:30:20 +0100 Subject: [PATCH] Windows11Style/WindowsVistaStyle: don't modify SE_ItemViewItemDecoration The windowsvista style increased the width for SE_ItemViewItemDecoration by 4 pixels which lead to a non-square area for the decoration item. Since the item is painted centered on the given area, this did not change anything for squared pixmap-based icons. But when using a svg, the image is automatically stretched to fill the complete area. Therefore a svg is not painted quadratic but stretched which is not what a user expects. Looking for other usages of SE_ItemViewItemDecoration did not reveal another usecase for this so it should be safe to remove the handling within windowsvista style. Fixes: QTBUG-131955 Change-Id: I65f8e2afd1c2fb310d6a23b1405a920adcbf42c3 Reviewed-by: Volker Hilsheimer (cherry picked from commit 298e8119222174cfb253272699e7fd90c1abf255) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/styles/modernwindows/qwindowsvistastyle.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp index e3d4fec2599..7923225aad2 100644 --- a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp +++ b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp @@ -4240,12 +4240,6 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption rect = QCommonStyle::subElementRect(SE_ProgressBarGroove, option, widget); break; - case SE_ItemViewItemDecoration: - rect = QWindowsStyle::subElementRect(element, option, widget); - if (qstyleoption_cast(option)) - rect.adjust(-2, 0, 2, 0); - break; - case SE_ItemViewItemFocusRect: rect = QWindowsStyle::subElementRect(element, option, widget); if (const QStyleOptionViewItem *vopt = qstyleoption_cast(option)) {