I have some fields in my class. I want to have Q_PROPERTY
on all these fields and also have getters and setters.
Example for the private field float pwm7Min
, I can get my getters and setters and also property using this code.
Q_PROPERTY(float pwm7Min READ getPwm7Min WRITE setPwm7Min NOTIFY pwm7MinChanged)
This is generated by automatic in QT.
Question:
But I want to Q_INVOKABLE
all the setters and getters. Is there a way to do that in QT by using QT Designer, or do I have to manually implement them by my self?
That's because I have got this error and the solution is Q_INVOKABLE
. But my .cpp
file is over 1000 lines of code and only contains getters and setters.
QMetaObject::invokeMethod: No such method IOcalibration::setInputCapture0Max(float)
It have origins from this problem: QMetaObject::invokeMethod: No such method when using inheritance