diff options
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 6 |
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()) { |