Fusion and windows11 style currently broken in Qt 6.7beta1?
-
Hi all,
while playing around with Qt 6.7beta1 I figured that both
fusion
andwindows11
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 fromQStyleHints
: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 theNormal color
, therefore disabled icons will be shown (incorrectly) the same when using Qt 6.7 both withfusion
andwindows11
style.I am wondering whether this is a bug in Qt 6.7 or I am doing something wrong for color handling?
-
Christian Ehrlicher Lifetime Qt Championreplied to DerReisende on last edited by 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.
-
@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
-
@Christian-Ehrlicher Just to make sure: Did you change the windows theme from light to dark and vice versa via System settings?
-
@DerReisende No, I did not change anything - just a plain main() and the debug output as written above in lack of a proper testcase.
-
@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:
And the incorrect version with Qt 6.7+:
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 Ehrlicher Lifetime Qt Championreplied to DerReisende on last edited by 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.
-
@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. -
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. -
@Christian-Ehrlicher Bug is reported.
-
@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 withQt::BackgroundRole
background color indata()
method andfusion
style:
Just switching the style to
windows11
produces this:
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.
-
@DerReisende
Let's keep the communication in the bugreport ticket.
My code comment was on implementation details. -
@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...
-
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. -
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.
-
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. -
The windows11 style was introduced in Qt6.7 - that there might be bug should be clear.
-