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

QPushButton menu arrow shifts position/size when border is applied via stylesheet

XMLWordPrintable

    • Windows

      When adding a QMenu to a QPushButton, Qt displays a small down-pointing arrow on the right side of the button (depending on the style/theme).
      If a stylesheet is used to set a border on the button, the arrow changes its position and size unexpectedly.

      This issue can be reproduced with the WindowsVista style.

      Steps to reproduce:

      1. Open the attached example project.
      1. Build and run it.
      1. Observe the two buttons:
        • pushButton1 has a border set via stylesheet.
        • pushButton2 does not.
      1. Notice that the menu arrow for pushButton1 is shifted and resized compared to pushButton2.

      Expected result:
      The arrow icon should remain consistent in position and size regardless of whether a border is set via stylesheet.

      Actual result:
      When a border is applied via stylesheet, the arrow shifts and changes size. (See attached screenshot, made with WindowsVista style.)

        1. QTBUG-139957.zip
          3 kB
          Chakib Boutaghane
        For Gerrit Dashboard: QTBUG-139957
        # Subject Branch Project Status CR V

            evenandersen Even Oscar Andersen
            chakib Chakib Boutaghane
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change