Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-68791

QML type system: Make it possible to verify the type correctness of binding expressions at build time

    XMLWordPrintable

Details

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtqmlteam Qt Qml Team User
              shausman Simon Hausmann
              Votes:
              6 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes