banner
Previous Page
PCLinuxOS Magazine
PCLinuxOS
Article List
Disclaimer
Next Page

Tip Top Tips: Qt5 Settings In Trinity


Editor's Note: Tip Top Tips is a semi-monthly column in The PCLinuxOS Magazine. Periodically, we will feature -- and possibly even expand upon -- one tip from the PCLinuxOS forum. The magazine will not accept independent tip submissions specifically intended for inclusion in the Tip Top Tips column. Rather, if you have a tip, share it in the PCLinuxOS forum's “Tips & Tricks” section. Your tip just may be selected for publication in The PCLinuxOS Magazine.

This month's tip comes from reelcat.

Since Qt5 apps appeared in PCLinuxOS, it was very annoying to me that I could not set up their appearance in Trinity. There was no problem with Qt4, even Qt3, but Qt5 apps changed their style, font, color etc exclusively in KDE Plasma 5. And there were quite a few of them: SMPlayer, VLC, Master PDF Editor, Openshot, and their number was growing.

When the Qt5ct config app appeared in our repo, I tried to configure the look of the Qt5-based applications, but to no avail. Qt5ct, a Qt5 app, did not change even itself, saying nothing of changing other Qt5 apps. I gave up, convinced that maybe a Qt5 library that did the look change was not present in my installed system, and I could not identify it.

But it lasted only until recently. One of the recent upgrades did make Qt5ct change its look. I started Googling, experimenting and I think I found a way to configure the look of Qt5 apps.

Run Qt5ct and set the look as you like. I used Fusion widget (close enough to Plastique), Crystalsvg icons (TDE default set) and Charcoal 10 font (for its excellent readability). You should see how Qt5ct will look with your settings. Also, you can define your colors for the whole theme.

Run Menu Configurator and add the option --platformtheme qt5ct at the end of the command for running a Qt5 application you want to change its look. For example, to change the look of QMPlay2:


QMPlay2 --platformtheme qt5ct

In most cases this should change the look of this application.

QMPlay2 before:


QMPlay2 after:


Notice that not only the font changed, but also the icons.

But not all application can support this suffix. VLC, for example, considers --platformtheme qt5ct as an invalid option and simply does not run at all. To solve this problem, a user-wide approach is needed. It turns out that the only thing to change the look of all Qt5 apps is setting the QT_QPA_PLATFORMTHEME variable, which is not set in TDE.

Of course, this makes unnecessary adding the --platformtheme qt5ct option at the end of program command and you can safely remove it.

As user, edit the file .bash_profile in your home directory. It is hidden so you have to turn on the option "Show hidden files". Add one line:


export QT_QPA_PLATFORMTHEME="qt5ct"

Save your work and re-login. Now all Qt5 applications should look as supposed.

I hope this short how-to will be useful for the PCLinusOS Trinity users to configure Qt5 applications.



Previous Page              Top              Next Page