Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.0
-
None
-
Windows 7, OSX 10.9.2
-
aa8d3f90a440575deef914916299b792105d7209 (qt/qtbase/5.13)
Description
NOTE: This bug is being reported against Qt release 5.2.1, although for some reason that release now appears to be missing from the "Affects Version/s" field, so I was forced to pick the nearest match, which is "5.2.0".
QTBUG-1395 still repros in 5.2.1, and it's impacting our product. I don't see any way to reactivate QTBUG-1395, so I'm creating this bug instead.
I have crafted a fix which appears to resolve this issue on both Windows and Mac on our end.
Perforce diff of the proposed fix:
==== //depot/third-party/qt/5.2/local/qtbase/src/widgets/styles/qcommonstyle.cpp#1 (text) ====
@@ -4820,7 +4820,7 @@
case CT_SpinBox:
if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt))
==== //depot/third-party/qt/5.2/local/qtbase/src/widgets/styles/qmacstyle_mac.mm#3 (text) ====
@@ -6085,7 +6085,7 @@
case CT_SpinBox:
if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt))
==== //depot/third-party/qt/5.2/local/qtbase/src/widgets/styles/qstylesheetstyle.cpp#2 (text) ====
@@ -4811,15 +4811,18 @@
switch (ct) {
case CT_SpinBox: // ### hopelessly broken QAbstractSpinBox (part 1)
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
- // Add some space for the up/down buttons
- QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
- if (subRule.hasDrawable())
{
- QRect r = positionRect(w, rule, subRule, PseudoElement_SpinBoxUpButton,
- opt->rect, opt->direction);
- sz += QSize(r.width(), 0);
- }
else {
- QSize defaultUpSize = defaultSize(w, subRule.size(), spinbox->rect, PseudoElement_SpinBoxUpButton);
- sz += QSize(defaultUpSize.width(), 0);
+ if (spinbox->buttonSymbols != QAbstractSpinBox::NoButtons)
+Unknown macro: {+ // Add some space for the up/down buttons+ QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);+ if (subRule.hasDrawable()) { + QRect r = positionRect(w, rule, subRule, PseudoElement_SpinBoxUpButton, + opt->rect, opt->direction); + sz += QSize(r.width(), 0); + } else { + QSize defaultUpSize = defaultSize(w, subRule.size(), spinbox->rect, PseudoElement_SpinBoxUpButton); + sz += QSize(defaultUpSize.width(), 0); + } }if (rule.hasBox() || rule.hasBorder() || !rule.hasNativeBorder())
sz = rule.boxSize(sz);
Attachments
Issue Links
- duplicates
-
QTBUG-1395 Issues with QAbstractSpinBox::NoButtons on Mac
-
- Closed
-
- relates to
-
QTBUG-67126 too wide size hint of QDoubleSpinBox when setting to mode "NoButtons"
-
- Closed
-