Here’s a comparison of the Bitcoin Core GUI cross-compiled from linux to Windows between master
and 0.21
:
Master | 0.21 |
---|---|
![]() |
![]() |
Yep, there’s something wrong here. We can gain some insight into what’s going on with the style by leveraging the logging of static plugins introduced in 957895c715f86feaa26c806e5fa8ebb77430a926. The master
branch already includes this commit. I cherry-picked it on top of the 0.21
branch here. Now if we take a look at the debug.log
for each, we’ll see the following
0.21 Branch:
02021-06-02T07:23:59Z Qt 5.9.8 (static), plugin=windows (static)
12021-06-02T07:23:59Z Static plugins:
22021-06-02T07:23:59Z QWindowsIntegrationPlugin, version 329992
32021-06-02T07:23:59Z Style: windowsvista / QWindowsVistaStyle
Master Branch:
02021-06-02T04:16:06Z Qt 5.12.10 (static), plugin=windows (static)
12021-06-02T04:16:06Z Static plugins:
22021-06-02T04:16:06Z QWindowsIntegrationPlugin, version 330752
32021-06-02T04:16:06Z Style: windows / QWindowsStyle
We notice that the master
branch’s style is set to windows
while the 0.21
branch is set to windowsvista
style. Looking at the Qt Widgets Gallery, you can observe that windows
style looks like Windows 95 while windowsvista
is the “sleeker”/“modern” QStyle for the Windows platform.
This is what has changed between master
and 0.21
and what is causing the GUI to look straight out of the 90’s (maybe this is a retro release? 🕺).
Now, what is causing this change? Well, I’m not completely sure. Otherwise I’d open up a PR. I do have some findings:
Different available QStyle Keys between Qt 5.9.8 and Qt 5.12 at runtime:
Looking at the Qt Widgets
section of the depends Qt configuration output, we can see the following styles are available:
0.21 Branch:
0Qt Widgets:
1 GTK+ ................................... no
2 Styles ................................. Fusion Windows WindowsXP WindowsVista
Master Branch:
0Qt Widgets:
1 GTK+ ................................... no
2 Styles ................................. Fusion Windows WindowsVista
So while it seems that in regards to how Qt is configured, WindowsVista
style is available in both cases, If we apply the patch below to see the available QStyle Keys at runtime, we don’t see windowsvista
as an available key on master
:
0qInfo() << QStyleFactory::keys().join(",");
0.21 Branch:
02021-06-02T17:43:35Z GUI: "Windows,WindowsXP,WindowsVista,Fusion"
Master Branch:
02021-06-02T17:03:11Z GUI: "Windows,Fusion"
This means that we can’t use the line below to fix the issue, and so a fix would involve changes to our build system:
0QApplication::setStyle("windowsvista");
Windows Vista Style moved to a Plugin in Qt 5.10:
This is based off what I found while looking for this issue online:
I have also ran into this issue with Qt 5.11.1. Qt’s Windows Vista style has been moved out to a separate DLL, which is styles\qwindowsvistastyle.dll. If you add this to the package, standard windows will get back their modern look.
I found a problem. After Qt5.10.1 the “windowsvista” style becomes a plugin. So in the final deploy file windowsvistastyle.dll schould exists. I add a folder “/styles” with this .dll and a problem is gone.
Ship style plugins, since native styles were moved into plugins as of Qt 5.10. This includes Windows Vista style on Windows and Adwaita on Linux.
If we figure out what needs to be done on the build side to link to this plugin, then we can use a similar patch as vlc to fix this and so the following is a solution:
0 Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin)