Greetings Qt centers,
I’m trying to load a QML module from the qrc file.
Here is how my qrc file looks:
<RCC>
<qresource prefix="/">
<file>content/Main.qml</file>
<file>content/SkyComponents/PushButton.qml</file>
<file>content/SkyComponents/qmldir</file>
</qresource>
</RCC>
<RCC>
<qresource prefix="/">
<file>content/Main.qml</file>
<file>content/SkyComponents/PushButton.qml</file>
<file>content/SkyComponents/qmldir</file>
</qresource>
</RCC>
To copy to clipboard, switch view to plain text mode
Here is how my Main.qml looks:
import SkyComponents 1.0
...
import SkyComponents 1.0
...
To copy to clipboard, switch view to plain text mode
I also added this in my cpp files:
wControllerDeclarative->engine()->addImportPath("qrc:/");
wControllerDeclarative->engine()->addImportPath("qrc:/");
To copy to clipboard, switch view to plain text mode
I get the following error:
Couldn’t create Main QML Object: qrc:/content/Main.qml:3 module “SkyComponents†is not installed
Couldn’t create Main QML Object: qrc:/content/Main.qml:3 module “SkyComponents†is not installed
To copy to clipboard, switch view to plain text mode
Is it possible to load qmldir(s) from the qrc file ?
Thanks.
Bookmarks