diff options
| author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2025-01-19 17:55:37 +0100 |
|---|---|---|
| committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2025-01-20 22:03:50 +0100 |
| commit | 2ec4c28470de115c16944653a5d4f6209452d56c (patch) | |
| tree | ff2a8722210643be6ef1d409508fa545192d743a /src | |
| parent | 9574e8cbef06b3b55d1f651b09d134aef7150aba (diff) | |
Windows11Style: don't set minimum width for QAbstractSpinBox
There is no need to set a minimum width for QAbstractSpinBox in
QWindows11Style::polish() as this might override the user preferences.
Also the minimum size handling is now properly done within
sizeFromContents().
Pick-to: 6.9 6.8
Change-Id: Ibc1fd7a6f862fc85e3739025b9de581aa235d74c
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/styles/modernwindows/qwindows11style.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index f3e168f0d3f..04245979dd6 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -34,7 +34,6 @@ QT_BEGIN_NAMESPACE static constexpr int topLevelRoundingRadius = 8; //Radius for toplevel items like popups for round corners static constexpr int secondLevelRoundingRadius = 4; //Radius for second level items like hovered menu item round corners -static constexpr QLatin1StringView originalWidthProperty("_q_windows11_style_original_width"); enum WINUI3Color { subtleHighlightColor, //Subtle highlight based on alpha used for hovered elements @@ -2173,13 +2172,6 @@ void QWindows11Style::polish(QWidget* widget) pal.setColor(QPalette::ButtonText, pal.text().color()); pal.setColor(QPalette::BrightText, pal.text().color()); widget->setPalette(pal); - } else if (widget->inherits("QAbstractSpinBox")) { - const int minWidth = 2 * 24 + 40; - const int originalWidth = widget->size().width(); - if (originalWidth < minWidth) { - widget->resize(minWidth, widget->size().height()); - widget->setProperty(originalWidthProperty.constData(), originalWidth); - } } else if (widget->inherits("QAbstractButton") || widget->inherits("QToolButton")) { widget->setAutoFillBackground(false); auto pal = widget->palette(); @@ -2230,13 +2222,6 @@ void QWindows11Style::unpolish(QWidget *widget) scrollarea->viewport()->setPalette(pal); scrollarea->viewport()->setProperty("_q_original_background_palette", QVariant()); } - if (widget->inherits("QAbstractSpinBox")) { - const QVariant originalWidth = widget->property(originalWidthProperty.constData()); - if (originalWidth.isValid()) { - widget->resize(originalWidth.toInt(), widget->size().height()); - widget->setProperty(originalWidthProperty.constData(), QVariant()); - } - } } /* |
