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

Qml module not found with the cmake qml module system

XMLWordPrintable

      The attached example is based on the Qt Creator QtQuick 6.2 application template, utilitizing the new cmake qml module stuff.

      Only a single C++ based Foo type is added.

      Out of the box Qt Creator will complain about the "import com.mycompany.foo" "QML module not found". Nevertheless, the application builds and runs correctly.

      The comment in https://www.qt.io/blog/qml-modules-in-qt-6.2 by David Hess shows the workaround:

      set(QML_IMPORT_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "" FORCE)

      • Is this actually the intended solution?
      • If that is the case, should this become part of the template?
      • Where is this documented?

      Not actually related to Qt Creator but: Why is the "import com.mycompany.foo" required at all? "main.qml" is part of the same module as "Foo", shouldn't this be visible implicitly?

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

            fawzi Fawzi Mohamed
            njeisecke Nils Jeisecke
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes