Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-105280

[REG 5.9 -> 5.12] Mac: Step buttons of spin box not aligned properly when the size is Mini or Small (WA_Mac attributes)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12, 5.15.10, 6.3.1
    • Widgets: Styles
    • None
    • macOS 11.6.8
    • macOS

    Description

      Steps to reproduce

      1. Compile and run the attached example on Mac (see some instructions I followed in README.txt)
      2. You'll see a widget containing two spin boxes: one spin box has the WA_MacSmallSize attribute set, the other one not.
      3. Look at the position of the step buttons.
      4. EXPECTED: The step buttons all the spin boxes are positioned properly (some white space + vertically aligned with the center of the edit field).
      5. ACTUAL: The step buttons of the spin box with the WA_MacSmallSize attribute set are not positioned nicely.

      Also reproducible with...

      • QDoubleSpinBox
      • WA_MacMiniSize

      Some more details

      In qmacstyle_mac.mm, the function QMacStyle::subControlRect contains a section for spin boxes. Somewhere between Qt 5.9 and Qt 5.12 a hack was introduced with the comment "

      // hack: position the buttons correctly (weird that we need this)

      This hack seems to be broken on my current Mac version (11.6.8). If I tweak this code a bit (see the .patch file in the attachment) I can fix the alignment issues. Not sure though if these tweaking is ok in general. In any case it is better to address the root cause and fix the hack in the first place.

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            catsareqt551 Willem Peerlinck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes