05-12-2013 11:26 PM
05-12-2013 11:40 PM - edited 05-12-2013 11:41 PM
When binding a C++ property (Q_PROPERTY) in QML it uses a signal specified in property's NOTIFY parameter to determine if variable has changed:
Q_PROPERTY(int myValue READ value NOTIFY valueChanged)
The expression is re-evaluated only when valueChanged signal is emitted, which is usually done in setter when the value changes. In other words, the code will be executed only once if setter is properly implemented.
05-12-2013 11:54 PM - edited 05-13-2013 12:00 AM
If you're exporting one of standard classes using setContextProperty, this sometimes works because in many classes properties already have corresponding Q_PROPERTY declarations.
05-13-2013 12:03 AM
05-13-2013 12:15 AM
05-13-2013 12:21 AM
05-13-2013 12:29 AM
05-13-2013 03:22 AM - last edited on 05-13-2013 05:48 AM by BelmaHFL