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

Implement QML code model in Qt

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • 6.6
    • None
    • QML: Tooling

    Description

      Implement a QML code model in Qt that is sufficient for Qt Creator and Qt Quick Designer.

      The code model would preferably have a public API that could also be used by third-party tooling.
      The current QML code model does work (somehow) but is not maintained.
      It is very hard to add new features (e. g. QML enums) to the existing code models
      Updating the AST to an updated version is a lot of work.
      The code model does create false positives for errors.
      The code model is prone to raise conditions.

      Ambiguities between pure QML and C++ bite us quite a lot with the current QML code model. Each 'object' might have a C++ based type name and a QML based type name (QtQuick.Item != QQuickItem).
      Those ambiguities have to be resolved. Similar ambiguities exist between property types (qreal, real, double) (string, QString).

      The ambiguities are especially hard to resolve when having QML types with item lists and C++ types with item lists. For the C++ types typically C++ pointer types get reported.

      Types from C++ cannot be directly 'parsed' since we cannot execute arbitrary C++ code. This is solved by .qmltypes files. There were regular corner cases that required hand editing the .qmltypes files.
      Enums are also a problem. QML enums are not supported at all. There is no way to detect enums by pure syntax. We need to maintain a list of all possible enums.

      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
              thohartm Thomas Hartmann
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes