Welcome!

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

Reply
Regular Contributor
Q-T
Posts: 94
Registered: ‎12-02-2011
My Device: non-Blackberry user

How to load qml files from a Qt resource file

Hi

 

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">
<qresource>
  <file>assets/main.qml</file>
</qresource>
</RCC>

 

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.

 

Thanks

 

 

 

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

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

this can help you

 

https://developer.blackberry.com/cascades/documentation/getting_started/tools/compiling.html

 

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