This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

GTK+ themes in Qt applications

From Gentoo Wiki (test)
Jump to:navigation Jump to:search

Qt Desktop applications need a little help to use your desktop theme in GNOME.

Setup

The GTK+ style for Qt can be built by setting the gtk USE flag for dev-qt/qtwidgets.

Set the gtkstyle USE flag.:

FILE /etc/portage/package.use
dev-qt/qtwidgets gtk

and rebuild the package with its new USE flag:

root #emerge --ask --changed-use qtgui

Configuration

You might need to reselect the preferred theme for Qt applications using qtconfig (from dev-qt/qt3support):

user $qtconfig

or just delete the previous configuration files:

user $rm -r ~/.config/Trolltech*

Select the Default theme to use your system settings or set it to use the GTK+ style explicitly by selecting GTK+ theme.

Tips

  • Individual applications might have their own configuration settings for their GUI, e.g. in VLC this is located in Tools → Preferences.

Caveats

  • 32bit applications on multilib systems are still unaware of the system's GTK+ theme, probably because app-emulation/emul-linux-x86-qtlibs is compiled without the gtkstyle USE flag enabled.

GTK+2 alternative

An alternative for users of GTK+2 and Qt5 is using the QtCurve cross-toolkit theme:

root #emerge --ask qtcurve

The downsides of this method are that it's not available for GTK+3 yet, and currently the only configuration GUI needs Qt5 and KDE Frameworks 5.