Thank you gunnar for reply,

I tried this:

public MyWidget extends QWidget{

    public MyWidget() {
           this.setStyleSheet("QWidget { qproperty-buttonsHeight: 70; }");
           System.out.println(this.property("buttonsHeight").toString());
    }
}

I get this message: "does not have a property named  "buttonsHeight" "
and then it throws a java.lang.NullPointerException

Thank you.
Best Regards
Massimo Fazzolari



2008/10/8 Gunnar Sletta <[EMAIL PROTECTED]>

> Massimo Fazzolari wrote:
>
>> Hi,
>>
>> I'm using .qss file in my project.I would like to define a "custom
>> property" on .qss file and access it from paintEvent defined in my QWidget
>> subclass.
>>
>
> Hi,
>
> This should be possible by spesifying custom properties in the stylesheet
> using the
>
> qproperty-propertyname : xxx
>
> syntax, outlined in the stylesheet documentation. The value of the property
> is then accessible using QObject::property("propertyname") at runtime.
>
> best regards,
> Gunnar
>
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to