[Qt-interest] QT Property system ?
Thiago Macieira
thiago.macieira at trolltech.com
Tue Aug 25 20:14:25 CEST 2009
Em Terça-feira 25 Agosto 2009, às 19:43:54, Paul Miller escreveu:
> Patric wrote:
> > Yes, ok, the question rather was "when to use them instead of simple
> > member".
> > As I understand, these are just like class member, but we can access them
> > even through a pointer to base class.
> > And another advantage is that we can add properties at runtime.
> >
> > Is that correct ? What other advantages are there ?
>
> You can do introspection.
> You can access properties in scripting with QtScript.
> You can access properties from Javascript inside a QWebView if you've
> attached your objects to the DOM.
You can access properties in QML as well, use them and set their values.
You can modify the properties using the Qt Animation Framework.
You can export those properties via QtDBus as well.
If you make your class a widget in Qt Designer, it will also allow the user to
edit the properties there.
You can set properties via setProperty(), retrieve via property() and find out
about them in the metaObject(). (this is why all the above work)
--
Thiago Macieira - thiago.macieira (AT) nokia.com
Senior Product Manager - Nokia, Qt Development Frameworks
Sandakerveien 116, NO-0402 Oslo, Norway
Qt Developer Days 2009 | Registration Now Open!
Munich, Germany: Oct 12 - 14 San Francisco, California: Nov 2 - 4
http://qt.nokia.com/qtdevdays2009
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090825/29e3f4bc/attachment.bin
More information about the Qt-interest-old
mailing list