[Qt-interest] Stylesheets and widget properties

Harry Sfougaris hsfougaris at gmail.com
Thu Oct 21 11:58:40 CEST 2010


Thanks Andre, that did the trick.

Harry

On 21/10/2010 12:52 μ.μ., "Andre Somers" <andre at familiesomers.nl> wrote:

>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é
>
>
>_______________________________________________
>Qt-interest mailing list
>Qt-interest at trolltech.com
>http://lists.trolltech.com/mailman/listinfo/qt-interest






More information about the Qt-interest-old mailing list