Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Fusion and windows11 style currently broken in Qt 6.7beta1?
Forum Updated to NodeBB v4.3 + New Features

Fusion and windows11 style currently broken in Qt 6.7beta1?

Scheduled Pinned Locked Moved Unsolved General and Desktop
18 Posts 5 Posters 5.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DerReisende
    wrote on last edited by DerReisende
    #1

    Hi all,

    while playing around with Qt 6.7beta1 I figured that both fusion and windows11 styles are currently broken for Light mode. All tests were done on the same Windows 11 machine:
    Windows 11 Pro 23H2 Build 22631.2861

    I am using the following code to set the icon colors on the colorSchemeChanged signal from QStyleHints:

    const auto palette = QGuiApplication::palette();
        ZFontIconOption::gColorDisabled = palette.color(QPalette::ColorGroup::Disabled, QPalette::ColorRole::ButtonText);
        ZFontIconOption::gColor = palette.color(QPalette::ColorRole::ButtonText);
    

    With Qt 6.6.1 I get the following (IMHO correct) values:

    Style:  "fusion"
    Color scheme:  Qt::ColorScheme::Light
    Disabled color:  QColor(ARGB 1, 0.470588, 0.470588, 0.470588)
    Normal color:  QColor(ARGB 1, 0, 0, 0)
    
    Color scheme:  Qt::ColorScheme::Dark
    Disabled color:  QColor(ARGB 1, 0.615686, 0.615686, 0.615686)
    Normal color:  QColor(ARGB 1, 1, 1, 1)
    

    However, Qt 6.7.0beta1 returns the following values:

    Style:  "fusion"
    Color scheme:  Qt::ColorScheme::Light
    Disabled color:  QColor(ARGB 0.894118, 0, 0, 0)
    Normal color:  QColor(ARGB 0.894118, 0, 0, 0)
    
    Style:  "fusion"
    Color scheme:  Qt::ColorScheme::Dark
    Disabled color:  QColor(ARGB 1, 0.499992, 0.499992, 0.499992)
    Normal color:  QColor(ARGB 1, 1, 1, 1)
    
    Style:  "windows11"
    Color scheme:  Qt::ColorScheme::Dark
    Disabled color:  QColor(ARGB 1, 0.499992, 0.499992, 0.499992)
    Normal color:  QColor(ARGB 1, 1, 1, 1)
    
    Style:  "windows11"
    Color scheme:  Qt::ColorScheme::Light
    Disabled color:  QColor(ARGB 0.894118, 0, 0, 0)
    Normal color:  QColor(ARGB 0.894118, 0, 0, 0)
    

    Note that the Disabled color in the Light mode in both styles is identical to the Normal color, therefore disabled icons will be shown (incorrectly) the same when using Qt 6.7 both with fusion and windows11 style.

    I am wondering whether this is a bug in Qt 6.7 or I am doing something wrong for color handling?

    Christian EhrlicherC 1 Reply Last reply
    0
    • D DerReisende

      Hi all,

      while playing around with Qt 6.7beta1 I figured that both fusion and windows11 styles are currently broken for Light mode. All tests were done on the same Windows 11 machine:
      Windows 11 Pro 23H2 Build 22631.2861

      I am using the following code to set the icon colors on the colorSchemeChanged signal from QStyleHints:

      const auto palette = QGuiApplication::palette();
          ZFontIconOption::gColorDisabled = palette.color(QPalette::ColorGroup::Disabled, QPalette::ColorRole::ButtonText);
          ZFontIconOption::gColor = palette.color(QPalette::ColorRole::ButtonText);
      

      With Qt 6.6.1 I get the following (IMHO correct) values:

      Style:  "fusion"
      Color scheme:  Qt::ColorScheme::Light
      Disabled color:  QColor(ARGB 1, 0.470588, 0.470588, 0.470588)
      Normal color:  QColor(ARGB 1, 0, 0, 0)
      
      Color scheme:  Qt::ColorScheme::Dark
      Disabled color:  QColor(ARGB 1, 0.615686, 0.615686, 0.615686)
      Normal color:  QColor(ARGB 1, 1, 1, 1)
      

      However, Qt 6.7.0beta1 returns the following values:

      Style:  "fusion"
      Color scheme:  Qt::ColorScheme::Light
      Disabled color:  QColor(ARGB 0.894118, 0, 0, 0)
      Normal color:  QColor(ARGB 0.894118, 0, 0, 0)
      
      Style:  "fusion"
      Color scheme:  Qt::ColorScheme::Dark
      Disabled color:  QColor(ARGB 1, 0.499992, 0.499992, 0.499992)
      Normal color:  QColor(ARGB 1, 1, 1, 1)
      
      Style:  "windows11"
      Color scheme:  Qt::ColorScheme::Dark
      Disabled color:  QColor(ARGB 1, 0.499992, 0.499992, 0.499992)
      Normal color:  QColor(ARGB 1, 1, 1, 1)
      
      Style:  "windows11"
      Color scheme:  Qt::ColorScheme::Light
      Disabled color:  QColor(ARGB 0.894118, 0, 0, 0)
      Normal color:  QColor(ARGB 0.894118, 0, 0, 0)
      

      Note that the Disabled color in the Light mode in both styles is identical to the Normal color, therefore disabled icons will be shown (incorrectly) the same when using Qt 6.7 both with fusion and windows11 style.

      I am wondering whether this is a bug in Qt 6.7 or I am doing something wrong for color handling?

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by Christian Ehrlicher
      #2

      I can only test with Qt6.8:

      const auto palette = QGuiApplication::palette();
      qDebug() << qApp->style()->name();
      qDebug() << palette.color(QPalette::ColorGroup::Disabled, QPalette::ColorRole::ButtonText);
      qDebug() << palette.color(QPalette::ColorRole::ButtonText);
      

      started app with '-style <name>'-->

      "windowsvista"
      QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
      QColor(ARGB 0.894118, 0, 0, 0)
      
      "fusion"
      QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
      QColor(ARGB 0.894118, 0, 0, 0)
      
      "windows11"
      QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
      QColor(ARGB 0.894118, 0, 0, 0)
      

      /edit: I can't find a commit between 6.git and 6.7.0 beta1 which could cause this but I might have overseen it.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      D 2 Replies Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        I can only test with Qt6.8:

        const auto palette = QGuiApplication::palette();
        qDebug() << qApp->style()->name();
        qDebug() << palette.color(QPalette::ColorGroup::Disabled, QPalette::ColorRole::ButtonText);
        qDebug() << palette.color(QPalette::ColorRole::ButtonText);
        

        started app with '-style <name>'-->

        "windowsvista"
        QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
        QColor(ARGB 0.894118, 0, 0, 0)
        
        "fusion"
        QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
        QColor(ARGB 0.894118, 0, 0, 0)
        
        "windows11"
        QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
        QColor(ARGB 0.894118, 0, 0, 0)
        

        /edit: I can't find a commit between 6.git and 6.7.0 beta1 which could cause this but I might have overseen it.

        D Offline
        D Offline
        DerReisende
        wrote on last edited by
        #3

        @Christian-Ehrlicher I downloaded -dev with the online installer and tested as well:

        [12:47:08.688871] [  debug   ] [thread 11776]   Style:  "windows11"
        [12:47:08.688898] [  debug   ] [thread 11776]   Color scheme:  Qt::ColorScheme::Dark
        [12:47:08.688921] [  debug   ] [thread 11776]   Disabled color:  QColor(ARGB 1, 0.499992, 0.499992, 0.499992)
        [12:47:08.688927] [  debug   ] [thread 11776]   Normal color:  QColor(ARGB 1, 1, 1, 1)
        [12:47:10.699453] [  debug   ] [thread 11776]   Style:  "windows11"
        [12:47:10.699473] [  debug   ] [thread 11776]   Color scheme:  Qt::ColorScheme::Light
        [12:47:10.699487] [  debug   ] [thread 11776]   Disabled color:  QColor(ARGB 0.894118, 0, 0, 0)
        [12:47:10.699493] [  debug   ] [thread 11776]   Normal color:  QColor(ARGB 0.894118, 0, 0, 0)
        

        Same behaviour. It is still incorrect here in light theme

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          I can only test with Qt6.8:

          const auto palette = QGuiApplication::palette();
          qDebug() << qApp->style()->name();
          qDebug() << palette.color(QPalette::ColorGroup::Disabled, QPalette::ColorRole::ButtonText);
          qDebug() << palette.color(QPalette::ColorRole::ButtonText);
          

          started app with '-style <name>'-->

          "windowsvista"
          QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
          QColor(ARGB 0.894118, 0, 0, 0)
          
          "fusion"
          QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
          QColor(ARGB 0.894118, 0, 0, 0)
          
          "windows11"
          QColor(ARGB 1, 0.498039, 0.498039, 0.498039)
          QColor(ARGB 0.894118, 0, 0, 0)
          

          /edit: I can't find a commit between 6.git and 6.7.0 beta1 which could cause this but I might have overseen it.

          D Offline
          D Offline
          DerReisende
          wrote on last edited by
          #4

          @Christian-Ehrlicher Just to make sure: Did you change the windows theme from light to dark and vice versa via System settings?

          Christian EhrlicherC 1 Reply Last reply
          0
          • D DerReisende

            @Christian-Ehrlicher Just to make sure: Did you change the windows theme from light to dark and vice versa via System settings?

            Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @DerReisende No, I did not change anything - just a plain main() and the debug output as written above in lack of a proper testcase.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            D 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @DerReisende No, I did not change anything - just a plain main() and the debug output as written above in lack of a proper testcase.

              D Offline
              D Offline
              DerReisende
              wrote on last edited by
              #6

              @Christian-Ehrlicher I created a q&d testcase. It is a zip file for a plain Qt Widgets app and I can recreate my problem with 6.7, qt6-dev. Style is hardcoded to fusion.
              See attached the correct image with Qt 6.6.1:
              661_correct.png
              And the incorrect version with Qt 6.7+:
              67plus_incorrect.png

              Just launch the app and switch dark/light mode in system settings. If normal and disabled colors are identical then the "INCORRECT VALUES" label will be visible

              Christian EhrlicherC 1 Reply Last reply
              0
              • D DerReisende

                @Christian-Ehrlicher I created a q&d testcase. It is a zip file for a plain Qt Widgets app and I can recreate my problem with 6.7, qt6-dev. Style is hardcoded to fusion.
                See attached the correct image with Qt 6.6.1:
                661_correct.png
                And the incorrect version with Qt 6.7+:
                67plus_incorrect.png

                Just launch the app and switch dark/light mode in system settings. If normal and disabled colors are identical then the "INCORRECT VALUES" label will be visible

                Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by Christian Ehrlicher
                #7

                Works fine for me with windows 10 and switching dark/light app mode during the testcase run. During dark mode normal is white, disabled is light gray.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                D 1 Reply Last reply
                0
                • Christian EhrlicherC Christian Ehrlicher

                  Works fine for me with windows 10 and switching dark/light app mode during the testcase run. During dark mode normal is white, disabled is light gray.

                  D Offline
                  D Offline
                  DerReisende
                  wrote on last edited by DerReisende
                  #8

                  @Christian-Ehrlicher I am on Windows 11 23H2. I dont have a Win10 machine for testing currently available :(
                  Light mode only has incorrect colors, dark mode should be as you have described.

                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • D DerReisende

                    @Christian-Ehrlicher I am on Windows 11 23H2. I dont have a Win10 machine for testing currently available :(
                    Light mode only has incorrect colors, dark mode should be as you have described.

                    Christian EhrlicherC Online
                    Christian EhrlicherC Online
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    I doubt this has something to do with the windows versions as afaics the palette is filled the same way - no matter if it's win10 or win11.
                    You can create a bug report to see if someone else can reproduce it.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    D 2 Replies Last reply
                    0
                    • Christian EhrlicherC Christian Ehrlicher

                      I doubt this has something to do with the windows versions as afaics the palette is filled the same way - no matter if it's win10 or win11.
                      You can create a bug report to see if someone else can reproduce it.

                      D Offline
                      D Offline
                      DerReisende
                      wrote on last edited by
                      #10

                      @Christian-Ehrlicher Bug is reported.

                      1 Reply Last reply
                      1
                      • Christian EhrlicherC Christian Ehrlicher

                        I doubt this has something to do with the windows versions as afaics the palette is filled the same way - no matter if it's win10 or win11.
                        You can create a bug report to see if someone else can reproduce it.

                        D Offline
                        D Offline
                        DerReisende
                        wrote on last edited by
                        #11

                        @Christian-Ehrlicher I am happy to see that the Qt guys are working on the bug report. Hopefully it will make it into beta2.
                        However after playing a few days with the windows 11 style and my app I think there are many more things that should be internally tested as it also destroys my QTreeView rendering :(
                        This is the expected result of my QTreeView and my custom QAbstractItemModel with Qt::BackgroundRole background color in data() method and fusion style:
                        6_7_fusion_listview.png

                        Just switching the style to windows11 produces this:
                        6_7_windows11_listview.png

                        No more custom background colors... :(

                        @Axel-Spoerl I have seen you commented on the gerrit patch for my bug report. Maybe you want to internally communicate this new strange behaviour as well.

                        Axel SpoerlA 1 Reply Last reply
                        0
                        • D DerReisende

                          @Christian-Ehrlicher I am happy to see that the Qt guys are working on the bug report. Hopefully it will make it into beta2.
                          However after playing a few days with the windows 11 style and my app I think there are many more things that should be internally tested as it also destroys my QTreeView rendering :(
                          This is the expected result of my QTreeView and my custom QAbstractItemModel with Qt::BackgroundRole background color in data() method and fusion style:
                          6_7_fusion_listview.png

                          Just switching the style to windows11 produces this:
                          6_7_windows11_listview.png

                          No more custom background colors... :(

                          @Axel-Spoerl I have seen you commented on the gerrit patch for my bug report. Maybe you want to internally communicate this new strange behaviour as well.

                          Axel SpoerlA Online
                          Axel SpoerlA Online
                          Axel Spoerl
                          Moderators
                          wrote on last edited by
                          #12

                          @DerReisende
                          Let's keep the communication in the bugreport ticket.
                          My code comment was on implementation details.

                          Software Engineer
                          The Qt Company, Oslo

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            anh1
                            wrote on last edited by
                            #13
                            app = QtWidgets.QApplication(sys.argv)
                            #['windowsvista', 'Windows', 'Fusion']
                            app.setStyle('windowsvista')
                            

                            Both Fusion and Windowns have a problem with Qt6.7+
                            Should use "windowsvista" instead!

                            Christian EhrlicherC 1 Reply Last reply
                            0
                            • A anh1
                              app = QtWidgets.QApplication(sys.argv)
                              #['windowsvista', 'Windows', 'Fusion']
                              app.setStyle('windowsvista')
                              

                              Both Fusion and Windowns have a problem with Qt6.7+
                              Should use "windowsvista" instead!

                              Christian EhrlicherC Online
                              Christian EhrlicherC Online
                              Christian Ehrlicher
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              @anh1 said in Fusion and windows11 style currently broken in Qt 6.7beta1?:

                              Both Fusion and Windowns have a problem with Qt6.7+

                              So you should create a bug report with the proper instructions on how to reproduce...

                              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                              Visit the Qt Academy at https://academy.qt.io/catalog

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                darobz
                                wrote on last edited by
                                #15

                                I am tired of Qt 6, only new bling-bling-features, the GUI which worked in Qt 5 became buggy.
                                Every update creates problems, in the 6.6 update the content of QComboBox was completely black in QScrollArea, then I changed to 6.72 and now have the next problems.
                                I don't set any windows-styles, but my dialogs are currently unusable in Win11, why people should use Qt if it even has problems to create the same output in Win10 and Win11? It must be assured that basic control elements work. It seems that there is no quality check at Qt anymore.

                                grafik.png

                                1 Reply Last reply
                                0
                                • Christian EhrlicherC Online
                                  Christian EhrlicherC Online
                                  Christian Ehrlicher
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  Time to register here but not for looking into the bug tracker to see that those issues are already fixed or in progress nor searching in the forum to find out how to use the windowsvista style... Nice.

                                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                  Visit the Qt Academy at https://academy.qt.io/catalog

                                  D 1 Reply Last reply
                                  0
                                  • Christian EhrlicherC Christian Ehrlicher

                                    Time to register here but not for looking into the bug tracker to see that those issues are already fixed or in progress nor searching in the forum to find out how to use the windowsvista style... Nice.

                                    D Offline
                                    D Offline
                                    darobz
                                    wrote on last edited by
                                    #17

                                    @Christian-Ehrlicher

                                    Of course I have searched the bug-tracker before:
                                    https://bugreports.qt.io/browse/QTBUG-124235
                                    https://bugreports.qt.io/browse/QTBUG-124150
                                    But other than stated in the bugtracker, the problem is not fixed in Qt 6.72.
                                    6.8 I did not test, the Final Release for 6.8 is 25.09.2024.
                                    And Qt 6.73 is not available.

                                    If i set 'windowsvista style', the problem is solved temporarily. But the customers of my software expect Win11-GUI-style on Win11.

                                    I understand that problems can occur with some user installed windows-themes. But there should be a test for the default Win11-configuration before a new release .
                                    The easiest would be a scrollable and sizeable widget with all standard GUI-elements.

                                    1 Reply Last reply
                                    0
                                    • Christian EhrlicherC Online
                                      Christian EhrlicherC Online
                                      Christian Ehrlicher
                                      Lifetime Qt Champion
                                      wrote on last edited by Christian Ehrlicher
                                      #18

                                      The windows11 style was introduced in Qt6.7 - that there might be bug should be clear.

                                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                      Visit the Qt Academy at https://academy.qt.io/catalog

                                      1 Reply Last reply
                                      1
                                      • Pl45m4P Pl45m4 referenced this topic on

                                      • Login

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups
                                      • Search
                                      • Get Qt Extensions
                                      • Unsolved