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

Checked QTooButton background can't be changed when using Windows 11 style

    XMLWordPrintable

Details

    • b0dec15d2 (dev), 8d0f76217 (6.9), 0a16b4d04 (6.8)

    Description

      When using a checkeable QAction in a QToolBar on Windows with the new Windows 11 style QToolButton doesn't offer any visual feedback other than the icon being depressed. I don't know if this is by desing. I tried to change the background color using css, but it doesn't work. The same exact code is able to modify the background color in Qt 6.3 or if I force a different style (e.g. QApplication::setStyle("fusion") )

       

      toolbar->setStyleSheet(
          "QToolBar {border: none;}"
          "QToolButton:checked {background-color: #ff0000;}"  // Change background color when checked
      );

       

      Checked action (top) vs unchecked (bottom):

       

      Attachments

        1. image-2024-12-25-09-46-09-808.png
          0.9 kB
          Luis Ángel San Martín
        2. qt5.15.png
          3 kB
          Luis Ángel San Martín
        3. qt6.3.png
          3 kB
          Luis Ángel San Martín
        4. qt6.8.png
          4 kB
          Luis Ángel San Martín
        5. qt6.8-fusion.png
          4 kB
          Luis Ángel San Martín

        Issue Links

          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
              luisangelsm Luis Ángel San Martín
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes