Qt Creator 10.0.1 doesn't read QML module type informations anymore
-
Qt Creator 10.0.1 Based on Qt 6.4.3 (MSVC 2019, x86_64) Built on May 4 2023 01:13:52 From revision d2b3c31e04Hello,
after upgrading to Qt 6.5 and Qt Creator 10.0.1, I can no longer use the IntelliSense for my C++ classes inside QML.For instance, if I have a simple class with
QML_NAMED_ELEMENT, and I instantiate inside a QML file, no autocompletion occurs regarding this class.In particular, I get a permanent warning on every
import <module>I do when importing my custom module, Qt's ones are fine.The warning is:
QML module contains C++ plugins, currently reading type informations...My CMake setup to make it work is the following:
# QML_IMPORT_PATH # Used by Qt Creator for IntelliSense (clangd/clazy) # Env variable that points to C:/Qt/6.5.0/msvc2019_64/qml if(DEFINED $ENV{QML_IMPORT_PATH}) list(APPEND QML_DIRS "$ENV{QML_IMPORT_PATH}") endif() list(APPEND QML_DIRS "${PROJECT_BINARY_DIR}") list(APPEND QML_DIRS "${PROJECT_BINARY_DIR}/SinteringCompanion") list(APPEND QML_DIRS "${PROJECT_BINARY_DIR}/SinteringCompanion/qml") list(REMOVE_DUPLICATES QML_DIRS) set(QML_IMPORT_PATH ${QML_DIRS} CACHE STRING "") -
Qt Creator 10.0.1 Based on Qt 6.4.3 (MSVC 2019, x86_64) Built on May 4 2023 01:13:52 From revision d2b3c31e04Hello,
after upgrading to Qt 6.5 and Qt Creator 10.0.1, I can no longer use the IntelliSense for my C++ classes inside QML.For instance, if I have a simple class with
QML_NAMED_ELEMENT, and I instantiate inside a QML file, no autocompletion occurs regarding this class.In particular, I get a permanent warning on every
import <module>I do when importing my custom module, Qt's ones are fine.The warning is:
QML module contains C++ plugins, currently reading type informations...My CMake setup to make it work is the following:
# QML_IMPORT_PATH # Used by Qt Creator for IntelliSense (clangd/clazy) # Env variable that points to C:/Qt/6.5.0/msvc2019_64/qml if(DEFINED $ENV{QML_IMPORT_PATH}) list(APPEND QML_DIRS "$ENV{QML_IMPORT_PATH}") endif() list(APPEND QML_DIRS "${PROJECT_BINARY_DIR}") list(APPEND QML_DIRS "${PROJECT_BINARY_DIR}/SinteringCompanion") list(APPEND QML_DIRS "${PROJECT_BINARY_DIR}/SinteringCompanion/qml") list(REMOVE_DUPLICATES QML_DIRS) set(QML_IMPORT_PATH ${QML_DIRS} CACHE STRING "")"Magically fixed" by rebooting the PC.
I guess the good old "Have you tried rebooting your PC?" suggestion still holds true. -
F fama_lab3d has marked this topic as solved on
-
"Magically fixed" by rebooting the PC.
I guess the good old "Have you tried rebooting your PC?" suggestion still holds true.Adding exact version number can help (example). Other changes from commit may also be helpful. Like adding
URIofqt6_add_qml_moduleas a last part of path to the plugin (and library) of a module and settingQML_IMPORT_PATHto its base directory path.
PerformingTools -> QML/JS -> Reset Code Modelwill may also be helpful.