PDA

View Full Version : Linux - Support system's theme change



agarny
10th July 2011, 10:51
Hi,

I have just noticed that though my application works as I would expect on Linux (Ubuntu 11.04), if I change my system's theme, then my application doesn't fully handle the change. The window border decoration will respect the theme, but the menus, dialog buttons, etc. won't.

I have just checked with the Qt (4.7.3) demos (which I manually built on my Ubuntu 11.04 box) and it's the same. They, in fact, use the same (default?) theme as my application. However, everything works as I would expect using Qt Creator 2.2.1.

So, what is the difference between my application / the Qt demos and Qt Creator? How do I go about ensuring that my application respects the system's theme?

Cheers, Alan.

P.S.: I have just checked on Windows and Mac OS X, and as far as I can tell everything works as expected, i.e. my application handles changes in the system's theme without any problem.

SixDegrees
10th July 2011, 13:46
Don't know exactly how to do this. But note that the theme is not a property of the Linux system - it belongs to the desktop currently in use, which could be Gnome, Kde or dozens of others. While there may be a few corresponding themes in Qt's toolkit, for the most part the diversity of Linux desktops will make this an exercise in frustration.

agarny
10th July 2011, 17:12
Yes, it would seem that it might end up being a waste of time to try to get things to work as I would hope. This being said, Qt Creator works as I would expect on Ubuntu 11.04, so...?