Solved import qml files from subfolder fails
-
I have the following project structure:
Now in the file
calqlatr.qml
I want to use the qml files from the subfoldercontent
if I add
import "content"
In
calqlatr.qml
it 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"));