Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-23986

QML code completion for "QtObject" fails when using Qt 5.15 qmltypes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 4.13.0-beta1
    • Quick / QML Support

    Description

      This bug is not visible in Qt Creator today, because it (incorrectly) always loads the old default builtin qmltypes that ship with Qt Creator. However, when https://codereview.qt-project.org/c/qt-creator/qt-creator/+/297761 is merged, the following error appears:

      import QtQuick 2.15
      
      Item {
          QtObject {} // marked as an error by the editor
      } 

      The problem here is that for Qt 5.15.0 "QtObject" no longer exists in the qml/QtQuick.2/plugins.qmltypes or qml/builtins.qmltypes that ship with it. Instead, it is now in qml/QtQml/plugins.qmltypes.

      The way this works in the dev branch of qtdeclarative is that the qmldir file for QtQuick has a "import QtQml" line (added in 8534634bd204ccdca3edcc244a35be6e81739fce). It sounds like Qt Creator needs to process that line.

      I'm not sure how Qt Creator should know that QtQml needs to be imported as a dependency of a QtQuick import in 5.15.

      ulherman shausman: Would it be possible to add that line to the qmldir files for 5.15.0 as well?

      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
              ckamm Christian Kamm
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes