Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.3.2
-
None
Description
I know there is a refactoring that auto creates the needed members, signals and methods for a Q_PROPERTY but I was wondering if it wouldn't be possible to just have an AUTO attribute on the Q_PROPERTY itself for the trivial cases. Something like
Q_PROPERTY (propName READ WRITE AUTO)
If READ and WRITE are both there both a getter and setter would be created. If just READ then just a getter and I suppose if just WRITE then just a setter/signal.
The methods, members, signals etc would all work just like the refactoring but the code would be "hidden". I can envision something similar to how the Qt Widgets UI code is done. The user can't modify that code because it can be regenerated at any time. If the user later realizes they want to control the implementation details they just remove AUTO and use an existing form of Q_PROPERTY and refactor the methods into existence. It would make view manager classes for QML much cleaner. It shouldn't impose any burden on maintainers since it will be documented what the AUTO keyword does.