Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
2f3b4ec528f48747a3b7e91e9a7254c25ce24c99
Description
Add an expected keyword to QML. expected properties behave similar to normal properties, except that we will emit a warning/error when they are not set.
One of the primary use cases for this are delegates. Instead of accessing model properties "via magic" in the delegate, we could then use expected properties instead.
The logic there would be that:
- if there are no expected properties, we use the same behavior as before and simply inject the model properties
- if a model contains at least one expected property, we set that property to match the model's role. We do not inject any properties from the model which are not expected
- if there is an expected property, and it is not in the model, we issue a warning
Attachments
Issue Links
- relates to
-
QTBUG-76887 Make object overrides more optimal
-
- Open
-