PDA

View Full Version : Style sheet and QStyle cohabitation



vratojr
24th September 2010, 16:59
Hello everybody, it may be that I'm raising an old problem but I haven't found any solution or whatever.

I'm using a subclass of QStyle in my application and I'm trying to do minor customization with a stylesheet.
The problem is that when I apply a stylesheet (even an extremely reduced one as you will see) to my application, the old colors of the style get screwed.
In particular, I have defined a sublcass of QLabel named StyLabel to which I set a Q_PROPERTY named lType. Then, If I apply a style sheet like:


StyLabel[lType="value"] { color: red}

the colors of the other QLabel, that uses a color different from QPalette::text, get screwed. Is this the unavoidable consequence of applying stylesheets or what?

Thanks.

Lykurg
24th September 2010, 17:13
Hello everybody, it may be that I'm raising an old problem but I haven't found any solution or whatever.Well, from the docs:
Warning: Qt style sheets are currently not supported for custom QStyle subclasses. We plan to address this in some future release.(you find that on the page "Qt Style Sheets")

vratojr
24th September 2010, 17:36
Doh, I don't know how many times I went through that page... :( Thank you for pointing out what was painfully obvious!:)

Lykurg
24th September 2010, 17:46
Doh, I don't know how many times I went through that page...Yeah, that happens. You specially skip things you don't want to see:D