PDA

View Full Version : main-window never shows up when I import desktop-components from a resource-file



Hedge
21st May 2011, 23:19
Project description:
My qml-desktop-applications uses the Qt Quick components for Desktop (http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/).

I compile all files from the desktop-components into a resource-file (which is embedded in the .exe-file).
The main.qml-file is loaded from the resources like this:


viewer.setSource(QUrl("qrc:/main.qml"));

main.qml starts with this line which seems to make trouble:


import "desktop-components/components"

Observed behaviour:


When I compile and execute the application everything works fine

When I move my application to another directory (or PC), the application's main window never shows up.

When I remove all desktop-components stuff and just define a simple Rectangle in main.qml it works.

When I load the qml-file (and therefore the desktop-components from the file-system instead of the resource-file it works (viewer.setSource(QUrl("main.qml"));
The problem doesn't occur when building my project for debug
The problem doesn't occur on OSX


Project file-structure:
MyProject
|- release
| |- MyProject.exe
|
|- desktop-components
| |- components
|
|- main.qml
|
|- qmlapplicationviewer