2

I have issue related to loading 1-2 qml files at the time of deployment. I have a code that runs well on emulator but does not load few qml file at the time of delpoyment. For example

this is my model and on itemClick want to load new qml

ListModel {    
 ListElement { name: "Help"; section: "Other";         path:      "settingsHelp.qml"; }
}

in Delegate I am loading this qml file like this

 help_stack.push(Qt.createComponent(Qt.resolvedUrl(path), help_stack));

Just for info, this seetingsHelp.qml exists in same folder

This code working perfectly on emulator and I have all the deployment setting in place in .pro file such as DEPLOYMENTFOLDERS and qtcAddDeployment. In Addition, I have different qml pages too which are working fine on Deployment so it means deployment setting are fine too I guess.

Regarding error there is no specific error on logs except one on screen

Error: Could not load: file://data/data/com.test.example/files/assets:/qml/help/settingsHelp.qml:-1 File not found

Any idea what could be problem

JNI_OnLoad
  • 5,472
  • 4
  • 35
  • 60

1 Answers1

0

Try to add your qml files along with your images in resource and address your qml from there.

Right click on your project and choose Add New. Select Qt Resource file. choose a name, select next and finish.

Open the resource file and add a prefix / to it.

Choose Add button and Add Files. Add the your qml files and the resources it is using.

In your application you can refrerence your qml files like:

QQmlApplicationEngine engine(QUrl("qrc:///myQML.qml"));
Nejat
  • 31,784
  • 12
  • 106
  • 138
  • I would also try this route. Nevertheless, I find irritating the Qt-QML attitude to have some working solution on a platform not working - for unknown reasons - on another supported as well... Seems we're losing portability and stability for features... What a pity... – CapelliC Mar 15 '14 at 10:03
  • I just tried it...and it says this (void QQmlApplicationEnginePrivate::_q_finishLoad(QObject*)): qrc:/src/other/help/settingsHelp.qml:-1 File not found – JNI_OnLoad Mar 15 '14 at 10:42