Details
Description
GTK theme emulation worked in version of Qt that came with the qgtk2 plugin (i.e. versions up to Qt 5.6.2). However, since the introduction of the qgtk3 plugin in Qt 5.8.0, GTK theme emulation has not worked on most major Linux distributions and desktop environments. I have tested on a variety of popular distributions and desktop environments, and have found that the only desktop environment where GTK theme emulation works is KDE. Below I have summarised the results of my testing and provided screenshots to show that GTK emulation is not working in 5.9.1.
Testing Method
On each distribution I installed Qt 5.6.2 (the last version that came with qgtk2) from qt-opensource-linux-x64-5.6.2.run, and Qt 5.9.1 (with qtk3) from qt-opensource-linux-x64-5.9.1.run, with all installation settings left at the default. I then opened a simple GUI application in the bundled Qt Creator (Qt Creator 4.0.3 with Qt 5.6.2, and Qt Creator 4.3.1 with Qt 5.9.1), ran the application and took screenshots. The Qt 5.6.2 screenshots show the GTK theme emulation working correctly, and thus how the theme should look, while the Qt 5.9.1 screenshots show that GTK theme emulation is not working.
On each distribution I also checked whether theme emulation worked correctly in Qt Creator 4.0.3 (built with Qt 5.6.2) and Qt Creator 4.3.1 (built with Qt 5.9.1). Theme emulation failing in Qt Creator clearly shows it's a Qt issue rather than an issue with my test program.
Linux Mint 18.2 Cinnamon, MATE, Xfce
Testing with the "Mint-X", "Mint-Y-Dark" and "HighContrast" themes, I found that GTK theme emulation failed with Qt 5.9.1 (qgtk3), but worked with the older Qt 5.6.2 (qgtk2). This can be seen in the attachments LinuxMint182Cinnamon.png, LinuxMint182MATE.png and LinuxMint182Xfce.png.
Testing Qt Creator, I found that GTK theme emulation did not work in Qt Creator 4.3.1 (built with Qt 5.9.1), but it did work in Qt Creator 4.0.3 (built with Qt 5.6.2), as shown in the attachment LinuxMint182CinQtCreator.png.
Fedora 26 GNOME 3
I tested with the built in "Adwaita", "Adwaita-dark" and "HighContrast" themes, I once again found that theme emulation failed with Qt 5.9.1 (qgtk3), but worked with the older Qt 5.6.2 (qgtk2), as shown in the attachment Fedora26GNOME3.png.
Testing Qt creator I again found that GTK theme emulation did not work in Qt Creator 4.3.1 (built with Qt 5.9.1), but worked fine in the older Qt Creator 4.0.3 (built with Qt 5.6.2).
Ubuntu 17.04 Unity
Testing with the "Ambiance", "Radiance" and "High Contrast" themes, once again Qt 5.9.1 (qgtk3) did not emulate the system GTK theme, but Qt 5.6.2 (qgtk2) did, as shown in the attachment Ubuntu1704Unity.png. Qt Creator 4.3.1 again did not emulate the GTK theme, while Qt Creator 4.0.3 did.
Debian 9.1.0 Cinnamon
Testing with the "Adwaita", "BlackMATE" and "ContrastHighInverse" Qt 5.9.1 (qgtk3) again failed, while Qt 5.6.2 (qgtk2) worked, as shown in attachment Debian910Cinnamon.png. Qt Creator was the same with 4.3.1 not working, while 4.0.3 worked fine.
Linux Mint 18.2 KDE and openSUSE Leap 42.3 KDE
Testing with KDE, I found that theme emulation worked with both Qt 5.9.1 (qgtk3) and Qt 5.6.2 (qgtk2).
Conclusion
Testing shows that GTK theme emulation does not work with Qt 5.9.1 on many of the major distributions and desktop environments, with the exception of KDE. KDE is, of course, written with Qt and as such they may have made additional provisions to ensure that GTK emulation works correctly.
I have previously tested Qt 5.8.0, Qt 5.8.1 and Qt 5.9.0 on a variety of distributions with the same result, i.e. GTK theme emulation didn't work. I had also tested Qt 5.7.0, and that too did not work, but that was because it came with no qgtk plugin at all.
Without GTK theme emulation applications appear defective, so I feel that it is very important that GTK theme emulation works correctly.
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-17618 Qt Creator doesn't use system gtk style
- Closed
-
QTBUG-54551 GTK integration is broken
- Closed
- relates to
-
QTCREATORBUG-14723 Black text on dark background in some widgets (dark system theme)
- Reported
-
QTBUG-70562 Platform themes don't respect QT_NO_GLIB envvar
- Open
-
QTBUG-14665 QGtkStyle doesn't apply current gtk+ window background color to qt/kde apps
- Closed
-
QTBUG-53844 [Regression] "GTK-theme-mimicking" theme broken in 5.7.0rc final (worked in 5.7.0rc_424)
- Closed
-
QTBUG-78793 Wrong icons used in Adwaita-Dark theme
- Reported
-
QTCREATORBUG-16828 Gnome/DConf text-scaling-factor affects QtCreator
- Closed