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

UI widget misalignment

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12.0, 5.13.0, 5.13.1
    • Widgets: Styles
    • None
    • macOS 10.14.6
    • macOS

    Description

      When using the default macOS style (-style macintosh), there is a terrible misalignment between various UI widgets. The attached example app and creenshots demonstrate this.

      Mac1.png is how it looks on macOS. Mac2.png is the same but with hinting lines showing various places of misalignment. Win.png is how it looks with the old good Windows style (-style windows on the command line).

      I see the following problems (all is placed using QGridLayout):

      1. QComboBox (row 3, column 2) has extra margins compared to QPushButton and QLineEdit above and to QCheckBox below.
      2. QRadioButton (row 5, column 2) is misaligned by 1px to the left compared to QPushButton, QLineEdit and QCheckBox.
      3. A group of QLineEdit and QComboBox at row 6 combined using QVBoxLayout has extra margins.
      4. Text of QLineEdit (row 2) and QComboBox (row 3) does not align vertically.
      5. Text of QCheckBox (row 4) and QRadioButton (row 5) does not align vertically.
      6. Text of QLabel in column 1 and the widget in column 2 is misaligned horizontally by 1 px at rows 2 (QLineEdit), 3 (QComboBox) and 5 (QRadioButton).
      7. Spacing between rows is not equal (it.s bigger between row 1 and 2, smaller between row 2 and 3 and even more smaller between further rows).

      All those mentioned problems break too many UI/UX guidelines. This is not how applications should look like. Compare the appearance to Win.png (where everything is aligned properly) to see the difference.

      Attachments

        1. mac1.png
          mac1.png
          60 kB
        2. mac2.png
          mac2.png
          62 kB
        3. mac3.png
          mac3.png
          63 kB
        4. MacMisalignment.pro
          0.1 kB
        5. main.cpp
          3 kB
        6. main.cpp
          2 kB
        7. win.png
          win.png
          55 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            dmik Dmitriy Kuminov
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes