Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 6.0.0, Qt Creator 7.0.0
-
-
627f6a2916 (qt-creator/qt-creator/8.0) 627f6a2916 (qt-creator/qt-creator/master) 627f6a2916 (qt-creator/tqtc-qt-creator/8.0)
Description
When registering a singleton instance using a named variable as the URI, the editor wrongly produces the inline error "QML module not found". However, when running the application, everything works as expected.
For example, with the following code in the main.cpp.
const char GUI_MAIN_URI[] = "Qt.example.Compile"; qmlRegisterSingletonInstance(GUI_MAIN_URI, 1, 0, "MyApi", example.get());
This produces and inline error message when trying to import the QML type as shown
import Qt.example.Compile 1.0
If one uses the string directly, like shown below. This error message goes away.
qmlRegisterSingletonInstance("Qt.example.Compile", 1, 0, "MyApi", example.get());
Note that both method will run correctly, so despite getting an inline error message, no error is produced at run time. I attached an example of this behavior.