Since I updated to Ubuntu 17.04, Qt5 applications (such as Qt Creator) won't use the GTK theme anymore. I tried to change this using qt5ct, but it only has the styles Fusion and Windows available, even though that the package qt5-gtk-platformtheme
is installed.
How can this be fixed?
Edit: I'm using Unity.
Best Answer
The look and feel of Qt5 applications is determined by platform themes and styles. The platform theme is responsible for icons, fonts, etc. and the style controls how widgets are rendered. I think you'll find your application such as Qt Creator is using the GTK3 platform theme as standard.
The problem has occurred since Qt5.7. In this release, the GTK2 platform theme and style was removed and replaced with the GTK3 platform theme. I've recently been in discussion with the Qt developers and it appears there isn't a GTK3 style to complement the platform theme and there are currently no plans to implement this in the future. Therefore, on Ubuntu, the default style is "Fusion" using the GTK3 platform theme.
There are a couple of methods to add a native style as follows:
qtstyleplugins
that can be downloaded here. Unfortunately, the GTK2 style is not compatible with the GTK3 platform theme. If you want to use the GTK2 style you will have to use the GTK2 platform theme. This will mean your dialogs etc. do not look native in Ubuntu 17.04. However, you may prefer it to "Fusion".QGnomePlatform
available here andadwaita-qt
available here. This provides a fully native look and feel when using Ubuntu Gnome.For Qt Creator, I'm not 100% sure if it uses global theme/style locations. You may have to install them in
{Qt_installation_folder}\Tools\QtCreator\lib\Qt\Plugins\platformthemes\
and{Qt_installation_folder}\Tools\QtCreator\lib\Qt\Plugins\styles\
.