PDA

View Full Version : Difference between QStyle and Style Sheet



nifei
7th November 2008, 09:25
regardless of ways to apply both of them, i wonder the difference(s) between them.

is Style Sheet able to do everything that QStyle does? and vice versa?:o

aamer4yu
7th November 2008, 09:55
From the Qt docs...

The QStyle class is an abstract base class that encapsulates the look and feel of a GUI. More...

and..

Style sheets are applied on top of the current widget style, meaning that your applications will still look native, but any style sheet constraints will be taken into consideration. Unlike palette fiddling, style sheets offer guarantees: If you set the background color of a QPushButton to be red, you can be assured that the button will have a red background in all styles, on all platforms.

So basically it seems that QStyle does the all drawing, taking into consideration style sheets
Hope I am right ;)