I have a property which does some calculation over the variable, but I don't want the reflected variable to reflect the UI, so I just need to do some calculations but the final result shouldn't reflect the UI in the property.
Just don't add a write accessor, e.g.
class MyClass : public QObject
{
Q_OBJECT
Q_PROPERTY(int myVar READ myVar NOTIFY myVarChanged) //No WRITE ...
public:
int myVar() const;
signals:
void myVarChanged(int myVar);
private:
int m_myVar;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With