summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Ehrlicher <[email protected]>2025-07-11 08:34:50 +0200
committerVolker Hilsheimer <[email protected]>2025-07-11 12:05:54 +0000
commit877d352e490fc80b87dc76b53f4877fbd91c1b08 (patch)
tree52715201f500dfbd39f2a6ba8be99de9211012c7 /src
parent92a7604c10b7a126131cd435efb4d5e6eeb756ca (diff)
QStyleSheetStyle: Don't calc size for CT_SpinBox when not handled
The default stylesheet for CT_SpinBox defines a native border which was added to the sizeHint even though it was already added by the base style. Amends 96adebed606cdbc73c73778917d777dc04c6e93e. Pick-to: 6.10 6.9 6.8 Fixes: QTBUG-133845 Task-number: QTBUG-130642 Task-number: QTBUG-132431 Change-Id: I2332c4f027a8f4cceb477ae239c348509e6e7356 Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 08178e7b685..f4b21d3b70d 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5269,7 +5269,11 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
if (rule.baseStyleCanDraw()) {
sz = baseStyle()->sizeFromContents(ct, opt, sz, w);
- } else if (spinbox->buttonSymbols != QAbstractSpinBox::NoButtons) {
+ if (rule.hasBox() || !rule.hasNativeBorder())
+ sz = rule.boxSize(sz);
+ return sz;
+ }
+ if (spinbox->buttonSymbols != QAbstractSpinBox::NoButtons) {
// Add some space for the up/down buttons
QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
if (subRule.hasDrawable()) {