[Interest] Interest Digest, Vol 25, Issue 70
deepblue842 at googlemail.com
Mon Oct 28 14:16:37 CET 2013
These are not mutually exclusive. You can use a stylesheet on top of a
QStyle; in fact this exactly how Qt works. There is always a style applied,
even if it is the native Windows/Mac/X11 style.
The advantage of stylesheets is that they are simpler and quicker to
implement - you can test them 'live' in the Designer.
Subclassing QProxyStyle gives you more control but its a lot more work. But
you can change things that are not possible with stylesheets, like the
icons used in messageboxes or even behavioural things like whether or not
sliders snap to their tick marks (look at StyleHints).
Stylesheets definitely have a performance penalty and I wouldn't recommend
styling an entire application that way; you'd be better off re-implementing
paint events. Both interfaces are really designed for making minor tweaks.
I would definitely go with stylesheets first. Read up on the documentation
to understand the box model and how sub controls are work.
> Date: Mon, 28 Oct 2013 11:04:14 +0000
> From: Graham Labdon <Graham.Labdon at avalonsciences.com>
> Subject: [Interest] qss vs qstyle
> To: "Interest at qt-project.org" <Interest at qt-project.org>
> <DA78E044FB673F438F102FC52CA4A62C05ADD7F0 at ASLUKEXSVR.avalonsciences.local>
> Content-Type: text/plain; charset="us-ascii"
> I am looking into the possibilities offered by Qt to provide my
> applications with a custom style.
> There appears to be a choice of using style sheets or to implement the
> style by deriving from QProxyStyle.
> What are the advantages of using one method over the other?
> Which is more efficient?
> Which is easier to implement and maintain
> Which is more flexible
> If anyone has any advice on which way I should go I would be grateful to
> hear from you
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest