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

Describe the JS root object in qmltypes

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • 6.2.0 Alpha
    • None
    • QML: Tooling
    • None
    • 5851195c4f8ea56d4641b5f1b68c7b79c4eca0fd (qt/qtdeclarative/dev)

    Description

      In order for tools to know about the JavaScript root object it should be described in a machine-readable format.

      Right now, Qt Creator has its own hard-coded description in the qmljs library. That description is chronically outdated and only available to QtCreator itself.

      We might use the qmltypes format to describe the JS root objects. I can envision a jsroot.qmltypes file, generated from a live QJSEngine by querying all internal classes. The qmltypes format neeeds to be adapted for that to work, though. In particular it needs:

      • A way to mark methods as untyped, which means that all the parameters and return types are just hints.
      • A way to mark a type as member of the JS root object.
      • A way to mark a type as JS builtin type, rather than QML type. Those would be "undefined", "boolean", "object", "number", "string", "symbol", "function", and therefore quite distinct from the QML builtins.

      Once we have that in place, we can properly talk about JavaScript in qmltypes. We might then add more cross-linking that tells us which JS builtin types or root object members can be converted to which QML types and vice versa.

      Attachments

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

        Activity

          People

            max.goldstein Maximilian Goldstein
            ulherman Ulf Hermann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes