Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Regular Contributor
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user
My Carrier: none

How to load qml files from a Qt resource file



I would like to put my qml files into a Qt resource file.  This is something I have done with Qt desktop.  However I am having difficultiy as it never resolves the path at run time.  I have something like this:


QmLDocument *qml = QmlDocument::create("qrc:/assets/main.qml");

I have trid putting the string into a Qurl but that  did not help. 


I have a resource file named asssets.qrc  that looks like this:

<!DOCTYPE RCC><RCC version="1.0">


I then compile it with rcc assets.qrc -o assets.cpp.  I then add it to my project and see that does compile.  but the run time error says it cannot resolve the url.


Can qml files be put into resources, if so what is the correct way to do it.






Posts: 24
Registered: ‎05-16-2013
My Device: Developer
My Carrier: Developer

Re: How to load qml files from a Qt resource file

this can help you




Mark the answer as sloved if my answer helped you...