Multiple Q_PROPERTY in the same class
Solved
General and Desktop
-
May I know is it ok for us to have multiple Q_PROPERTY within the same class? So far it can work by returning the value in val and valTest to me correctly. However, I not sure is it ok to do this or not, so I would like to ask for your advice, thank you.
Example is as shown below:
class Animal:public QObject{
Q_OBJECT
Q_PROPERTY(int val READ val WRITE setVal NOTIFY valChanged)
Q_PROPERTY(int valTest READ valTest WRITE setVal NOTIFY valChanged)public: // declaration of other func int val(){ return //something } int valTest(){ return //something }
};