Qt 6.11 is out! See what's new in the release
blog
import qml files from subfolder fails
-
I have the following project structure:

Now in the file
calqlatr.qmlI want to use the qml files from the subfoldercontentif I add
import "content"In
calqlatr.qmlit looks fine but when I try to run the app i get this error:QML debugging is enabled. Only use this in a safe environment. qrc:calqlatr.qml:2:1: import "content" has no qmldir and no namespace import "content" ^What Is wrong here? Whats the correct way to import qml files from a subfolder?
-
Found the issue myself.
I wrote in the main.cpp:
view.setSource(QUrl("qrc:calqlatr.qml"));instead of
view.setSource(QUrl("qrc:/calqlatr.qml"));