PDA

View Full Version : ideas for skinned widgets



kernel_panic
28th June 2007, 06:35
Hi all,
i've written a qtclass for skinned widgets (own titlebar with moving and resizing) but im not really lucky about my solution.
isn't it possible to do this in an QStyle subclass? i want to draw the frame and the titlebar like i do that now, but i want to skin the buttons and every other things,too. For everything i have a template pixmap and i want to have a "skin-file" in which i say which pixmap is for the buttons, the titlebar .... This file should be in xml.
Then i would like to pack the pixmaps and in another file (a zipped file or something like this).
The QStyle subclass schould open this zipped file read out all data he needs and skin my app. althought i want to change the skin on the fly and give th QStyle subclass another file for read out.
The problem is, i don't know how to zip all the files and read them out and i don't know how to add the resizing and the moving in the QStyle sublcass, can anyone help me?
Everything in Qt 4.3.
If you don't really undertstand what i mean, please tell me.

fullmetalcoder
28th June 2007, 09:33
The title bar stuff must be handled in a custom widget. AFAIK it would be extremely difficult (maybe impossible) to implement it properly from a QStyle. As for the rest Style sheets (http://doc.trolltech.com/4.3/stylesheet.html) should fit all your needs, even exotic ones, and they are ready to use!!! just write a QSS file (Qt Style Sheet), load it, and there you are :)

kernel_panic
28th June 2007, 12:10
hm, i thought about that but in a style sheet i can't extract pixmaps from my zipped style file. and i have to resize the pixmaps, get special regions from my template pixmap(i want to use pixmaps like windows xp does) aso.
thanks for reply

spud
28th June 2007, 15:10
If you pack the skin files in a rcc file, you can access the files from the style sheet with the ":/" notation. see The Qt Resource System (http://doc.trolltech.com/4.3/resources.html) and QDir::setSearchPaths().

vasanth
20th August 2007, 11:56
hi guys,

can say how to create a skin widgets

bye from

vasanth

wysota
20th August 2007, 12:33
Could you elaborate on the problem?