[Qt-interest] Stylesheets and widget properties

Harry Sfougaris hsfougaris at gmail.com
Thu Oct 21 10:07:37 CEST 2010


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?

Thank you,
Harry Sfougaris


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101021/8e7fdf0a/attachment.html 


More information about the Qt-interest-old mailing list