QT apps appearance under GNOME

I am using openSUSE 11.2 64 bit with the GNOME desktop. I have installed several QT based applications such as Krita and Umbrello and while they work fine the look they present doesn’t fit in with the rest of my desktop. Specifically the widget style in those applications feature small rounded buttons with a tendency towards using blue for highlights and focus selection.

Is there a way to change the widget set used by QT applications when running under GNOME? I tried changing things in qtconfig however it doesn’t seem to have any effect on these applications. I’m wondering if there is a KDE utility or something I should install in order to control this behavior and could use a pointer in the right direction.

There’s already a topic from the pre-release days, and a bug tracker ticket. Apparently there is a build somewhere on the build service with the “let Qt use GTK theme” option enabled, but I’ve asked which it is and haven’t had an answer.

Thanks, kind of disappointing if there is no workaround because the Qt apps just look awful when in the wrong context.

Works for me with this repo:

Index of /repositories/KDE:/Qt/openSUSE_11.2

Seems to work here as well after I changed the setting to “GTK+” in Qt Config (it updates Qt to 4.6 from 4.5 as well, although I don’t know what benefit that gives). Now, if only a) someone had said that in the ticket in the month since I posted it and b) I didn’t need yet another repo installed.

Oh well, at least my Qt apps will look reasonable now rather than being hideously KDE-ish in style :slight_smile:

Thanks for the tip on the repository, it appears the GTK+ option only appears in Qt 4.6 as it was not there in my original Qt 4.5 hence why the upgrade is needed.

If you read the ticket linked from the other thread then it seems like it is a build-time option, not a version thing. Qt 4.4 had the separate “GTK style” for Qt, but 4.5 moved the code in to the main source tree as an optional build-time component. The problem is that openSUSE 11.2 disables it at build-time, so the default Qt doesn’t support GTK themes. The difference with the 4.6 repo is that it has been built with the GTK option enabled.

Thanks for the explanation IBBoard, one further question though is that I updated all my Qt libraries from that repository, set the Qt4 GUI Style to GTK+ yet my QT applications still look they are running under KDE with rounded buttons, blue highlights, etc. Am I missing a step as I did the upgrade using the software manager in YAST and when I search on qt4 in the Installed section everything was 4.6.0-77.2 as expected.

I’ve tried rebooting as well but no difference there.

All I did was add the repo, run up “Install Software”, switch to “repositories” view, select the Qt repo, install everything (and resolve a couple of dependency issues by telling it to switch installed versions), run Qt Config, change from Clearlooks to GTK+, click File > Save and File > Quit, then run up Qwit (the main Qt app I use) and it used my GTK theme.

(Well, actually, I installed the Qt updates, ran Qwit, didn’t see a change, then realised I might need to check Qt config, which fixed it :slight_smile: )

Since I’m a bit stumped as to what the issue is, I installed Qwit just to try to duplicate your results IBBoard. Qwit appears to use the GTK+ style and looks great on my system as it matches the Gnome style just fine. However the other two KDE applications I use, Krita and Umbrello, still look like ****. I was thinking maybe it was a Qt3 versus Qt4 issue so I explicitly ran the Qt3 version of qtconfig and changed it’s GUI style but this wasn’t reflected in those two applications.

I’m wondering if there is a KDE utility (like KControl) that you would need to run to change the style of these applications?

I have had a similar problem in 11.1 with some apps (QSvn, I think) that still used Qt3 so they still used the Qt style. The Qt apps I use are Qwit (which picks up the style), Virtual Box (which picks up the style) and Opera (which does a fantastic job of being unreadable by picking up the style on the menus but having custom themes, so the text isn’t readable - how did they manage to make such a hideous browser across all platforms).

Unfortunately, if they are Qt3 apps then Qt3 doesn’t have the same integration mechanism. I thought there might be an engine for it, but I’m not sure how good it was or whether it was just an approximation (or the engine for the other way around - GTK apps looking like Qt under Qt/KDE).

Checking the dependencies of the RPMs should tell you which toolkit they need, or you could try running “ldd /path/to/app/binary |grep -i qt” and seeing what the output is.

I found this post under the Ubuntu forums talking about installing kdebase-workspace in order to gain control of KDE settings. Is the kde4base-workspace package the same thing in openSUSE, looking at the dependencies it appears to bring a lot of stuff in and I’m reluctant to install it without having some comfort level around it.