The only solution I've found is to let the environment do the work for you, as noted here: https://forum.kde.org/viewtopic.php?f=17&t=90720
A snip from the posts:
So you wish to start Amarok with a different colour scheme to the rest of KDE? You can do this by having a different set of settings for it.
Open Konsole, and enter "export KDEHOME=$HOME/.kde4-amarok/" Then run "systemsettings" and configure how you would like Amarok to appear ( colour scheme, etc. ) Finally, run "amarok" to start Amarok itself.
This will work for QT applications as well, but you can't set the style from within the application like you're trying (app.setStyle(QStyleFactory::create("oxygen");
) You'll have to use a slightly messier method:
sys.argv.append("--style=Oxygen")
This will read the argument from the environment, and won't make a whole new Oxygen theme instance, (assuming you've set the KDEHOME
environment to somewhere in your project, and you've already customized that) and will then use that KDEHOME
to read the colors from and use the Oxygen
theme.
Maybe they'll change this for QT5... (The ability to set a style programmatically)