From a1e3d310edfb000ccead035618a40d44a3aedcfe Mon Sep 17 00:00:00 2001 From: Wladimir Leuschner Date: Mon, 4 Mar 2024 16:26:26 +0100 Subject: [PATCH] QWindows11Style: Draw ScrollArea opaque in QAbstractItemView Change-Id: Ica2c62355a576dda4eaefacbc41b8609009d0073 Reviewed-by: Oliver Wolff --- .../styles/modernwindows/qwindows11style.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index e54dc5d9e87..1016316f28e 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -1724,19 +1724,6 @@ QRect QWindows11Style::subControlRect(ComplexControl control, const QStyleOption QRect ret; switch (control) { -#if QT_CONFIG(combobox) - case QStyle::CC_ComboBox: - if (const QStyleOptionComboBox *combobox = qstyleoption_cast(option)) { - switch (subControl) { - case SC_ComboBoxEditField: - ret = combobox->rect.adjusted(8,0,0,0); - break; - default: - ret = QWindowsVistaStyle::subControlRect(control, option, subControl, widget); - } - } - break; -#endif #if QT_CONFIG(spinbox) case CC_SpinBox: if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast(option)) { @@ -1969,9 +1956,11 @@ void QWindows11Style::polish(QWidget* widget) widget->setPalette(pal); } else if (widget->inherits("QAbstractScrollArea") && !widget->inherits("QMdiArea")) { - if (auto scrollarea = qobject_cast(widget)) { + if (const auto *scrollarea = qobject_cast(widget)) { QPalette pal = widget->palette(); - pal.setColor(scrollarea->viewport()->backgroundRole(), Qt::transparent); + QColor backgroundColor = widget->palette().base().color(); + backgroundColor.setAlpha(255); + pal.setColor(scrollarea->viewport()->backgroundRole(), backgroundColor); scrollarea->viewport()->setPalette(pal); } }