02-08-2013 02:14 AM
I am curious to know how do I access variables declared in c++ classes in QML. I read this by using set Context property we can bind object of a class with QML. Which help us to access public member function of that class, but
is there any way to access public variable as well?
02-08-2013 06:19 AM - edited 02-08-2013 06:20 AM
And with getter method preceded by Q_INVOKABLE. For slot method, it's not necessary.
About Q_PROPERTY, just add something like :
Q_PROPERTY (int value READ getValue WRITE setValue NOTIFY valueChanged)
Then, you will have dynamic binding property.
You can use Q_ENUMS too, to set constante.