[Interest] so it turns out there *is* a way to get Qt5 apps to use a custom style automatically?

René J.V. Bertin rjvbertin at gmail.com
Fri Sep 4 12:19:24 CEST 2015


I was tinkering with an old install of (K)Ubuntu's "Project Neon5" which allowed to have a working KF5 ("KDE 5") install in a parallel tree on a Kubuntu 14.04 system using a KDE4 desktop. It comes with a wapper script for calling KF5 applications from the commandline that sets up the callee's environment appropriately.

I discovered that when launching a pure Qt5 application (linked against Qt 5.3.2 in the Neon5 tree)
1) launched without the neon5-exec wrapper, the default Fusion style is used
2) launched *with* the neon5-exec wrapper, the style is used that's selected through KF5's appearance control module.

Again, this is a pure Qt5 application that doesn't use any KF5 frameworks, so something in the environment has the effect that I'd love to replicate on OS X. I'm testing this with the QtCurve style, which is installed in the neon5 KF5 style directory, but which I install in Qt's own plugin directory on OS X.
A bit of testing confirms that QT_PLUGIN_PATH is involved, but on my OS X machine the style plugin is already in the plugin path, so something else must be required to make it the default style.

Does anyone have an idea exactly how pure Qt5 applications can be given a custom style through the environment, and also if that's bound to work on OS X? (I suppose it should since KF5 is supposed to function on OS X too, one day...)


More information about the Interest mailing list