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

Qt Creator editor shows QML Module not found even though qt_add_qml_module is working and the app works

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • Qt Creator 14.0.0
    • Qt Creator 11.0.3, Qt Creator 12.0.0-beta2, Qt Creator 13.0.0-rc1
    • Quick / QML Support
    • None
    • All
    • 1d0246a89 (master), a59c93d20 (13.0)

    Description

      I am working on a Qt6.5 QML application. We would like to use the qml_add_qml_module to add QML modules in subdirectories. We followed the directions available at https://doc.qt.io/qt-6/qtqml-writing-a-module.html to create a module, but when we tried to import the module, Qt Creator told us the module wasn't found. (It also greyed out components from that module on the editor.). However, when we run the project, the module is imported and the application runs fine.

      I tried clean, rebuild, deleting the build directory and building again. Deleting the CMakeLists.txt.user file and reloading and configuring the project as well. In each case, the app runs correctly, but the editor still complains it can't find the QML module and the component from the module is grayed out.

      The only way I could get the editor to not show the error is if I reconfigured the project from fresh in a different directory location. Then there is no error on the import of the module, and the components imported show up green in the editor.

      I have attached a sample project that I was using to test this. Note, since loading it fresh, you will probably see that MyModule and AnotherModule are loaded properly. The problem arises when I add another module (created a subdirectory with module definition and added it via the directions from Qt documentation)

      Is there a way to add a new module that would avoid this problem in the editor?

      Attachments

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-29826
          # Subject Branch Project Status CR V

          Activity

            People

              sami.shalayel Sami Shalayel
              sharon.woods Sharon Woods
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes