Qt 5 on Lubuntu 14.04

General discussion about web technology.
Post Reply
barbaz
Senior Member
Posts: 9147
Joined: Sat Aug 03, 2013 5:45 pm

Qt 5 on Lubuntu 14.04

Post by barbaz » Fri Apr 22, 2016 2:52 am

Didn't realize how much of a mess this would be, nor how little search engines would know about it, so just going to leave this here..

Problem: Qt 5 apps on Lubuntu 14.04 look like a crappy version of the Qt 4 style, and controls/widgets don't fully work properly. Furthermore, there aren't really any Qt 5 themes available for Lubuntu 14.04

Well, there isn't really any good solution, as far as I can figure. But we have almost enough to work with what we've got.
Step 1 is to get some way to configure Qt 5 at all. Installing qt5ct - run these commands in Terminal:

Code: Select all

sudo add-apt-repository ppa:hda-me/qt5ct
sudo apt-get update && sudo apt-get install qt5ct

Oh, bummer, our nice Qt 4 theme isn't listed there (in my case am using Oxygen theme). And this configuration tool doesn't seem to have any effect on other Qt 5 apps?
Well, http://www.webupd8.org/2015/11/configure-qt5-application-style-icons.html to the rescue. In a Terminal, enter:

Code: Select all

export QT_QPA_PLATFORMTHEME="qt5ct"

Now any Qt 5 apps run from that Terminal will be configured as in qt5ct. Select Fusion theme in qt5ct, and run a Qt 5 app from that Terminal to test how it looks. Once sort-of satisfied there, edit ~/.profile, add that export line, now log out & log back in (yes, this works for me, despite the article saying it doesn't work).
Not quite done - though Qt 5 apps look sane now they probably stick out like a sore thumb relative to everything else. If this is the case, can grab Qt 4 colors:
1) qt5ct, select Custom palette, Create (once that's done, cancel out of qt5ct, we don't want to actually use a custom colors right yet)
2) Open ~/.config/Trolltech.conf, copy the color list from the line that starts like this

Code: Select all

Palette\active=

3) Open ~/.config/qt5ct/colors/<yourcolorschemename>.conf, overwrite the color list on the line that starts "active_colors=" with the list we just copied
4) back in qt5ct, select Custom color palette, edit the color scheme, and click to build inactive & disabled palettes.

Okay so this isn't perfect but at least not an eyesore now ;)


Oh, and one more thing. DO NOT DELETE ~/.config/qt5ct AFTER RUNNING ANYTHING TO DO WITH QT 5!!!!!!!!!!!!!!!!! YOU *WILL* REGRET IT. Trust me, I learned that the hard way.
*Always* check the changelogs BEFORE updating that important software!
-

Post Reply