Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How to import a QML component from resource file in a Qt Quick application using resource file based QML files?

$
0
0
Hello, I wrote a Qt Quick QML application loading all QML resources from a resource file. All files are on the same directory level and everything works well. Now I want to add a QML Component with sub – components placed in a subdirectory. The path structure inside the resource file is /qml/myapp/ /qml/myapp/mycomponent On the path /qml/myapp/ is my main QML file located (which works without import) and in /qml/myapp/mycomponent is the MyComponent.qml which I want to import to use it. On a file systen based QML application I just do a import “myComponent” in the head of my QML File but in the resource file based version it does not work for me. import QtQuick 1.0 import "mycomponent"   Rectangle {     id: testScreen     width: 1024     height: 768     color:  "#ffffffff"    MyComponent  {    } } Can anybody tellme what the correct syntax? Or is it not possible to import another QML component from a resource file if the root QML file is already located in the resource file? Thanks Michael

Viewing all articles
Browse latest Browse all 4972

Trending Articles