Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
There is plenty of opportunity to get QProperties wrong. When formulating a QML binding in terms of other properties which have neither NOTIFY nor BINDABLE, one gets a warning like "QQmlExpression: Expression qrc:/main.qml:15:9 depends on non-NOTIFYable properties". When doing the same in C++, no error and no warning is generated. This will lead to bugs. To help people find these bugs, it would be nice to have a "validation mode":
In "validation mode", properties evaluate in each read access. If the value changes, even though their dirty flag is not set, they generate an error.
This validation mode could be implemented inside of ifdefs, then there is no overhead when it is unused. But then, using validation mode would require a recompile of QT.
Or it could be steered by an environment variable. That would make the validation mode very usable (just run "QT_PROPERTIES_VALIDATION=1 ./myapplication") but every read access to a property having a binding would need to check this flag. Given that it has to check the dirty flag in each read anyway, the performance hit might be very small.