PDA

View Full Version : Customizig widgets ... ¿skins?



hipogrito
18th April 2007, 21:43
Hi:

A very newbie question, I guess.

I'm using QT 4.2 and Designer.

I want to customize some of the common widgets so they look as I want to.

For example:

- Slider: I want to use my own slider graphics... I want the same behavior but I want to use my own custom graphics...

- Button: In Visual Studio I can change the background image of a Button quite easily with the Image property...but keeping the text of the button... Here, in the Designer I see the Icon, but not the whole background Image property... where do I change this?

How can I do these things in designer?


Is there a "Skin" concept in QT as in PHP Nuke or things like that? So we just change some graphic files and the widgets automatically look as we want to?

Thanks!!

Regards,
Hipo

jacek
18th April 2007, 21:54
Is there a "Skin" concept in QT as in PHP Nuke or things like that? So we just change some graphic files and the widgets automatically look as we want to?
No, but there is a concept of "style", which controls all of the drawing process, and there are style sheets.

See QStyle.

marcel
18th April 2007, 21:55
In Qt you have to use styles mostly to customize the appearance.
Take a loom at the Styles example in the Qt Demos, the Widgets section and you'll get an idea.

Of course, you could also implement a skin system, using images and stuff... But styles are better if you want to customize more controls.

Regards

hipogrito
18th April 2007, 22:42
Hi:

Thank you both for your quick replies :)

I missed that part of the demos! :rolleyes:

A small piece missing in these demos is that they go directly into the code... and not from Designer... In Designer I see this Change styleSheet when I right click in a widget, but then there is just a blank text box... and I don't think the idea is to put C code there, so I guess I'm missing some other kind of demo or tutorial where it is explained what to put there... some kind of XML?, or CSS?, or ... ?

Thanks!

Regards
Hipo

jacek
18th April 2007, 23:05
I'm missing some other kind of demo or tutorial
Yes, it's called "documentation" ;)

http://doc.trolltech.com/4.2/stylesheet.html
http://doc.trolltech.com/4.2/overviews.html

hipogrito
18th April 2007, 23:10
Hi:

Thanks... yes... I didn't find this under the Qt Designer in the Qt Assistant... but I see it was in other place... :confused:

Thanks :)

Hipo

jacek
19th April 2007, 00:30
I didn't find this under the Qt Designer in the Qt Assistant...
Qt Designer is only a tool that helps you to layout the widgets, so you shouldn't expect much from it.