Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
Description
The facilitate the development and refactoring of large scale QML based projects, we want to be able to verify the correctness of types and properties used in QML binding expressions at application build time.
As a consequence of QTBUG-63600 we conclude the desire to enable a type verification mode on a per-file basis ("pragma typed"). Once enabled this would enable various features:
- Functions must declare the types for the parameters they take, for example function moveBy(x: i32, y: i32)
- Signal handlers must use the function expression syntax: onClicked: function handle(event: MouseEvent)
- Assignments to variables are checked for type compatibility.
- The type of the return value of a binding expression is checked for type compatibility against the type of the property the binding applies to.
- Item views may need to be extended with type API that allows specifying the type of "cell" data that the models expose, in order to verify the existence and compatibility of properties used in item view delegates.
- The build system and tooling may need to be extended to allow extraction of all relevant type information from C++ classes (Q_OBJECT/Q_GADGET) entirely at build-time.
This larger task results in smaller individual JIRA tasks required for the overall completion.
Attachments
Issue Links
- depends on
-
QTBUG-68796 Create plugin.qmltypes automatically at build time
- Closed
- resulted from
-
QTBUG-63600 Investigate support for TypeScript in QML
- Closed
- split to
-
QTBUG-102414 Possibility to verify that view types and models match
- Reported