I did an app loading qml from local filesystem, and it was working fine, but now I'm trying to change it to load from qml, but it never find my file.
I've looked into the web and tried some solutions, nothing worked.
My qml file is in a subdirectory of the project qml/MyProject/main.qml
Then I created a resource file and added a prefix "/" (tried with different names too), and then added my qml file to it.
Then I changed the generated qtquick2applicationviewer.cpp setMainQmlFile to: http://pastebin.com/kRJDJACW
Then I tried the following lines to load the qml from resource:
viewer.setMainQmlFile("qrc:/main.qml");
viewer.setMainQmlFile("qrc://main.qml");
viewer.setMainQmlFile("qrc:/other_prefix/main.qml");
viewer.setMainQmlFile("qrc:/qml/MyProject/main.qml");
viewer.setMainQmlFile("qrc://qml/MyProject/main.qml");
My resource file: http://pastebin.com/1sjUqk2T
Qt version: 5.2/ QtCreator 3.0
What am I doing wong?
QML_IMPORT_TRACEto get more detailed information what gets loaded. - Sebastian Dressler