QML don't work when I save it into resource file


QML don't work when I save it into resource file



I have got resource file for my program.
Structure is like this:


resources.qrc
|__ /
|__ qml
|___ Sample.qml
|___ SlabData.qml
|___ SlabImage.qml



In Sample.qml I am using SlabData, wich is stored in SlabData.qml, but it keeps writing me error:


Sample.qml


SlabData


SlabData.qml


file::/qml/Sample.qml:38:5: SlabData is not a type
SlabData{



I tried to import "./SlabData.qml, but it didn't work either.


import "./SlabData.qml



Is there any way I can use other qml file, wich is in same resource?



Thank you!



EDIT: Added example


Item {
SlabItem{anchors.fill: parent}

Rectangle {...}
}





You cannot import QML file. Sibling files are imported automatically. You should import QML module or a folder instead. Did you read Import Statements? Please provide Minimal, Complete, and Verifiable example
– folibis
Jul 2 at 13:03










By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

JMeter fails on beanshell imports

Why in node-red my HTTP POST no receive payload from inject?

PHP contact form sending but not receiving emails