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

Checkable QMenu item indicator stylesheet broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.1
    • Widgets: Style Sheets
    • None
    • Windows 10
      Qt 5.12.1
    • All

    Description

      When we try to set an image for QMenu::indicator:exclusive:checked via stylesheets (assuming we have a QActionGroup that handles the checkable QActions), this generates a non-reversible collateral behaviour: All unchecked QMenu item indicators are sunk.

      And setting QMenu::indicator:exclusive:unchecked will change nothing for the sunken border. I tried to remove border, to change the border style, to set an empty image or a non-empty image, ... I also tried to deal with QMenu::item or QMenu::icon with and without :checked/:unchecked, ... Nothing works.

      The bug does not appear if we keep the default indicator but if with set an image for the checked state, all unchecked items are sunk no matter what we do (even if we define the unchecked state too).

      You can find more details (context, screenshots, ...) about the bug here.

      I have tried with Qt 5.12 and Windows 10. I cannot tell if the bug appears with other versions of Qt or other operating systems.

       

      EDIT: The bug also appears with non-exclusive checkable actions (and with or without QActionGroup).

      Attachments

        1. bug_reproduction_screenshot.PNG
          bug_reproduction_screenshot.PNG
          2 kB
        2. bug_reproduction.cpp
          0.8 kB
        3. bug_reproduction.h
          0.2 kB
        4. bug_reproduction.pro
          0.1 kB
        5. checked.png
          checked.png
          6 kB
        6. qtbug_77344.cpp
          0.6 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
            fareanor Raphaël Lefèvre
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes