Why and when to use Q_PROPERTY
Hello All,
I am new to QT and am learning it for my present job so I apologize for any dum questions.
I have read the information on the Qt Assistant regarding the macro Q_PROPERTY. Although Assistant gives the 'syntax' it does not give the why and when to insert such properties into a class derived from QObject.
What criteria should I use to decide to create / insert properties in my class designs derived from QObject?
Does the Qt framework make use of them?
The same questions are asked of the use of dynamic properties.
Thanks,
Vanir
Re: Why and when to use Q_PROPERTY
Quote:
Originally Posted by
Vanir
I have read the information on the Qt Assistant regarding the macro Q_PROPERTY. Although Assistant gives the 'syntax' it does not give the why and when to insert such properties into a class derived from QObject.
In Q_PROPERTY docs, there's a link to more verbose article: Qt's Property System
Re: Why and when to use Q_PROPERTY
Hi,
there's no dum questions ;)
rather not asking is dummy
Q_PROPERTY is required whne developing QtDesigner plugins(that extends designer by new custom widgets).
Q_PROPERTY macro adds informations that allow designer to add a property t property editor (and change its value at design time).
It can be omitted in other cases, so u may ignore it until first QtDesigner plugin writing.
Re: Why and when to use Q_PROPERTY
Properties are also useful in scriptable objects.
Re: Why and when to use Q_PROPERTY
Hi Everyone,
Thank you for your hard-earnt knowledge.
I am sure to post again.
Vanir