-1

I'm using Qt 5.5 to create a small app. In the app, I'm manually creating a component like so:

QQmlComponent component(engine, QUrl("qrc:/Box.qml"));
assert(component.isReady());

My .qrc file IS included in the .pro file like so:

RESOURCES += qml.qrc

All works well when I run from Qt creator. However, when I deploy the app using the macdeployqt tool and try to run the app I get that assert hit. Sure enough, I tried to put a loop around the .isReady() and it will hang forever.

What is the proper way for doing this? My qml component is working fine when in the Qt creator, so why does it fail in deployment?

Thanks

4

1 回答 1

0

事实证明这很简单。你需要传递-qmldir=<path to your qml files>macdeployqt. 如果您有 QML 文件,它实际上是必需的,但我在文档中没有看到它。

于 2016-03-17T14:22:25.993 回答