Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QML Module not found with registered types

Tags:

qt

qt-creator

qml

I have the following Issue:

In main.qml I get these errors. Although I can use these types perfectly in the code. It looks like it is just an intellisense issue.

f5bb7882-0104-47bb-be23-e2d160bc7c2c-image.png

These types are registered in main.cpp:

e745d480-b943-490b-9bba-f253dc8f4974-image.png

Thse classes are defined in the include folder:

My folder structure looks like this:

a4997bc8-5c83-459d-85e0-de8fb6eade18-image.png

Do I have to modify QML_IMPORT_PATH in the pro file? I added src and include folder but it does not work:

QML_IMPORT_PATH += src
QML_IMPORT_PATH += include

The code itself runs fine. It is just an Intellisense issue.

like image 731
Sandro4912 Avatar asked Nov 06 '22 03:11

Sandro4912


1 Answers

I assume this is simply a Qt Creator bug. Take a look at this one. qmlRegisterSingletonInstance was added to the Qt library in version Qt 5.14. Even though Qt Creator 4.13.3 was built with Qt 5.15.2, the QML code model it uses has apparently still not been updated.

like image 71
JarMan Avatar answered Nov 15 '22 08:11

JarMan