Bug 347547 - Qt4 applications use wrong palette and icons w/ Breeze
Summary: Qt4 applications use wrong palette and icons w/ Breeze
Status: RESOLVED NOT A BUG
Alias: None
Product: Breeze
Classification: Plasma
Component: general (show other bugs)
Version: 5.3.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Development Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-11 08:06 UTC by Matthias Dahl
Modified: 2015-05-27 07:37 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
qtconfig w/ KDE_SESSION_VERSION=4 (96.12 KB, image/jpeg)
2015-05-11 08:10 UTC, Matthias Dahl
Details
qtconfig w/ KDE_SESSION_VERSION=5 (99.00 KB, image/jpeg)
2015-05-11 08:10 UTC, Matthias Dahl
Details
vlc main window w/ KDE_SESSION_VERSION=4 (62.13 KB, image/jpeg)
2015-05-11 08:11 UTC, Matthias Dahl
Details
vlc main window w/ KDE_SESSION_VERSION=5 (63.53 KB, image/jpeg)
2015-05-11 08:11 UTC, Matthias Dahl
Details
vlc file dialog w/ KDE_SESSION_VERSION=4 (35.54 KB, image/jpeg)
2015-05-11 08:11 UTC, Matthias Dahl
Details
vlc file dialog w/ KDE_SESSION_VERSION=5 (35.88 KB, image/jpeg)
2015-05-11 08:12 UTC, Matthias Dahl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Dahl 2015-05-11 08:06:13 UTC
If Breeze is configured for Qt4 applications through qtconfig, all Qt4 applications will use an incorrect color palette as well as icon set depending on KDE_SESSION_VERSION: If it is set to 4, the styling works just fine but if it is set to 5, the color palette is off and the wrong icon set is picked up.

I have attached several examples that show the differences in VideoLAN and qtconfig itself.

Reproducible: Always
Comment 1 Matthias Dahl 2015-05-11 08:10:06 UTC
Created attachment 92533 [details]
qtconfig w/ KDE_SESSION_VERSION=4
Comment 2 Matthias Dahl 2015-05-11 08:10:26 UTC
Created attachment 92534 [details]
qtconfig w/ KDE_SESSION_VERSION=5
Comment 3 Matthias Dahl 2015-05-11 08:11:09 UTC
Created attachment 92535 [details]
vlc main window w/ KDE_SESSION_VERSION=4
Comment 4 Matthias Dahl 2015-05-11 08:11:25 UTC
Created attachment 92536 [details]
vlc main window w/ KDE_SESSION_VERSION=5
Comment 5 Matthias Dahl 2015-05-11 08:11:50 UTC
Created attachment 92537 [details]
vlc file dialog w/ KDE_SESSION_VERSION=4
Comment 6 Matthias Dahl 2015-05-11 08:12:09 UTC
Created attachment 92538 [details]
vlc file dialog w/ KDE_SESSION_VERSION=5
Comment 7 Matthias Dahl 2015-05-11 08:15:33 UTC
To clarify: All screenshots were taken in a KDE 5.3.0 session naturally. I simply set KDE_SESSION_VERSION for the specific application to 4 or 5 -- and not globally. :-)
Comment 8 Matthias Dahl 2015-05-19 18:31:08 UTC
Further investigation revealed the following:

1)
If KDE_SESSION_VERSION=5, kdeglobals is first searched for in "~/.kde/" while with KDE_SESSION_VERSION=4 it is "~/.kde4/". This comes as a surprise since kdelibs is configured properly with kde4 and kcoreaddons with prefix "4". And since KShareConfig and alike use KStandardDirs (which should all be ".kde4"), I don't see where the ".kde" comes from at all. The environment is clean as well, no KDEHOME or alike is set.

2)
Setting a symlink .kde -> .kde4 works around the problem and no matter what KDE_SESSION_VERSION (4 or 5), Qt4 apps show properly.

3)
The color that doesn't get picked up when not everything is properly in place is "BackgroundNormal" from the "Colors:Selection" section of kdeglobals.

4)
I filed a bug downstream with Gentoo as well (https://bugs.gentoo.org/show_bug.cgi?id=549824), since this might very well be a packaging bug (or perhaps partly) since I am not able to reproduce this on either OpenSuSE Tumbleweed nor Kubuntu. Nevertheless, any help on this matter would be greatly appreciated since I have spent countless hours trying to hunt this problem down and I am still at it, unfortunately. :(
Comment 9 Matthias Dahl 2015-05-19 18:34:38 UTC
I forgot to mention in (1): Setting KDE_SESSION_VERSION to either 4 or 5 only influences whether ".kde4" or ".kde" is first searched, but after that, ".kde4" is always searched as well. So setting K_S_V to 5 does not result in ".kde" exclusively being searched at all... it is just searched first while with 4 it is not searched at all ever.
Comment 10 Matthias Dahl 2015-05-21 15:28:18 UTC
Turns out it was a packaging error after all: The gui platform plugin for Qt4 ("qguiplatformplugin_kde") was not being pulled in/installed and thus causing all the described trouble. 

Sorry for all the unnecessary fuss here but tracking this down was really painful and time-consuming -- and I only came to realize what was causing it after investigating it through good-old fashioned gdb. :)
Comment 11 Martin Klapetek 2015-05-21 15:36:40 UTC
Hey nice investigation!

Thanks for the details, might come handy sometime :)
Comment 12 Rex Dieter 2015-05-23 23:14:22 UTC
Just so we could consider giving a heads-up to other packagers, when you say "The gui platform plugin for Qt4 ("qguiplatformplugin_kde") was not being pulled in/installed", what is that exactly and where is does it come from?

I'm asking mostly, because the other gui platform plugin for Qt4 I've ever seen, is the one that comes from kde-workspace-4.11.x
Comment 13 Weng Xuetian 2015-05-27 04:08:26 UTC
On Chakra, we just build it from kde-workspace and make it a separate package called kde4-integration. And it seems that this plugin only depends on kdelibs4.
Comment 14 Matthias Dahl 2015-05-27 07:37:01 UTC
Sorry for not answering sooner but honestly I simply forgot. :-(

(In reply to Martin Klapetek from comment #11)
> Hey nice investigation!
> 
> Thanks for the details, might come handy sometime :)

Glad I was of help. :) And that gave me a nice excuse to finally do some C++ stuff again (nowadays you simply don't get much freelance work related to C++ which is super sad) and dive deep into how to debug Qt w/ naked gdb. ;-)

(In reply to Rex Dieter from comment #12)
> I'm asking mostly, because the other gui platform plugin for Qt4 I've ever
> seen, is the one that comes from kde-workspace-4.11.x

That's exactly where it comes from like Weng Xuetian already stated above. If that one is missing, you only have Qt's own internal logic which is not too sophisticated, e.g.:

http://code.qt.io/cgit/qt/qt.git/tree/src/gui/kernel/qkde.cpp#n59

That's pretty much why w/o the plugin, Qt is looking in ".kde" for kdeglobals if KDE_SESSION_VERSION is anything other than 4.

To make a long story short: If you want Qt 4 apps to integrate well into KDE 5, you will need that plugin installed which in-turn depends on kdelibs4. Otherwise you are asking for trouble -- one way or the other. :-)