Hi,
Why should one use Q_PROPERTY? as in what advantage does it have over declaring the corresponding attributes and associated READ and WRITE functions as private/public??
Thanks
Hi,
Why should one use Q_PROPERTY? as in what advantage does it have over declaring the corresponding attributes and associated READ and WRITE functions as private/public??
Thanks
Properties can be written and read through QObject interface.
You can access the properties without knowing anything about the class in use.
Qt's Property System
It's not the fastest possible way to access data members of a class, the value of properties comes from genericity.
J-P Nurmi
It's used for example by the Qt Designer to change widgets' settings.Originally Posted by nupul
Actually you will still need to write such methods. Q_PROPERTY just informs Qt about them.Originally Posted by nupul
how does this help? i mean how is it different from declaring a private attribute and corresponding methods..Any advantage?Originally Posted by jacek
Look at the Qt Designer --- it doesn't know anything about custom widgets, yet if you create a custom widget plugin, you will be able to change that widgets' properties. How would you implement this without Q_PROPERTY?Originally Posted by nupul
nupul (3rd April 2006)
Bookmarks