PDA

View Full Version : Re-skinning



davidgould
8th July 2010, 20:17
I am transitioning over to Qt4 from another embedded GUI product where I can re-skin a UI without recompiling any code. There is an engine that runs on the target. And a tool that allows me to create a GUI skin - the look/feel UI such as widget colors, location of buttons, etc. Then I write application code to hook the skin into the engine running on the target. So the 3 are all separate, the engine, the GUI skin and the application code.

I can reskin (or rebrand) an application without recompiling the engine or the application code. Meaning I can replace the GUI skin on the fly, just drop it onto the target.


2 questions:

A) Trying to determine if and how I can do that with QT.
Any advice is greatly appreciated.

B) Does QT have the notion of a separate GUI skin where all the UI elements (button, images, color settings, etc.) are all contained in one single binary file. I see a file called the ".ui" file, but this looks like XML and so I do not believe that it contains images, etc. I am trying to determine if QT rolls the entire look.feel (GUI) into one file where I can move it from project to project?

Thanks so much for any help,
Dave

kennethadammiller
9th July 2010, 03:01
Actually, you could create your own "skin engine". Basically, every button and every widget can be modded to use an image or something as it's appearance. you could have your program load all it's appearances from a single xml, or binary or zip or whatever, and then set it up so that whenever it loads all of this, it will load the pictures and stuff that it needs to make the gui's appearance.

also, you might want to check into the different platform based appearances that qt has. who knows, you might be able to overload one of those, or inherit from it-whatever. Like, if you want, you can make qt look like x, or mac, or windows. that only takes one line.

If you get into qt designer, you could probably find a way to change each object's appearance, but that would take a while.

aamer4yu
9th July 2010, 05:40
Read about QStyle and Qt Style Sheets (http://doc.qt.nokia.com/4.6/stylesheet.html)