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

QSS text alignment for QPushButton with styled menu-indicator broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2.1, 6.2.2, 6.3.1
    • Widgets: Style Sheets
    • None
    • macOS, Windows

    Description

      The text alignment within a QPushButton doesn't respect the buttons padding anymore, if the

      QPushButton::menu-indicator

      is styled within its style sheet. From the box model point of view it looks like the text is not in the content box anymore but in the padding box.

      • As you can see in the images, Qt 5.15.X works as expected.
      • Starting with Qt 6, when the menu-indicator is styled and a menu is set onto the button, the text starts at the outer left side, regardless of the padding (which was respected in Qt 5).

       

      Edit:

      I added a different images & an updated example project to show the problem.

       

      Attachments

        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
            vjungbluth Victor Jungbluth
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes