[Qt-interest] Stylesheets and widget properties

Andre Somers andre at familiesomers.nl
Thu Oct 21 11:52:39 CEST 2010


Op Do, 21 oktober, 2010 10:07 am, schreef Harry Sfougaris:
> I am using a combination of setProperty("required", true) on my Widgets
> and an appropriate stylesheet
> eg. *[required="true"] { font: bold; }, to indicate required fields, which
> works fine.
> In some cases, I need to change the "required" property on some of the
> widgets, based on user input (eg. they select something from a combo,
> which determines which fields on the form are required).
> The change I make with setProperty is of course is not picked up by the
> stylesheet automatically, but I can't seem to find any function to force
> something like a re-evaluation/re-drawing. I tried using
> (myWidget)->style()->polish(this) but it doesn't seem to do anything.
>
> Can anyone please help?

http://developer.qt.nokia.com/forums/viewthread/1333 discusses this issue.

André





More information about the Qt-interest-old mailing list