Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 3.0.1, Qt Creator 3.1.0-beta, Qt Creator 3.2.0-beta1
-
None
-
5b5ae971045adebe40209150cf9e1cac6cc62191 (qt-creator/qt-creator/master)
Description
After implementing QTCREATORBUG-1890 the getter and setter work quite nice.
But there is the pattern of the setter emitting a signal, currently the pattern is:
void setSomething(type something) { m_something = something; }
This could be easily extended to:
void setSomething(type something) { if (something == m_something) return; m_something = something; emit somethingChanged() }
Of course the signal somethingChanged() would be also autocreated.
This is not a reopen on QTCREATORBUG-1890, because you wont always (but very often) want to emit a signal.
Also, this fix, in conjunction with the wonderfully auto Q_PROPERTY creator already in place would make life even easier as the pattern of creating properties is very common.