-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

bitwise
  • 541
  • 6
  • 16
  • 1
    Can you post more code? Mabe you can test if is loading with isLoading() if the assert hits – Sommerwild Mar 17 '16 at 10:06
  • This was actually the same issue as my other question on the QmlComponent. I wasn't aware you need to pass -qmldir= to the macdeployqt tool. – bitwise Mar 17 '16 at 14:19

1 Answers1

0

This turned out to be simple. You need to pass -qmldir=<path to your qml files> to macdeployqt. It is actually required if you have QML files but I somehow didn't see it in the documentation.

BaCaRoZzo
  • 7,502
  • 6
  • 51
  • 82
bitwise
  • 541
  • 6
  • 16