[PyQt] building QML resources using pyqtdeploy on iOS

Phil Thompson phil at riverbankcomputing.com
Tue Jan 6 22:36:24 GMT 2015


On 06/01/2015 9:26 pm, lloyd konneker wrote:
> Any hints about how to manage QML resources on a pyqtdeploy build to
> iOS?  In other words, what process do others use?
> 
> My code is:  QQuickView(QUrl("qrc:/qml/Document.qml")) which I
> understand to mean: let Qt find the resource in data compiled into the
> executable using rcc.
> 
> I compile my resource directory using pyrcc5 into a myApp_rc.py, and
> that works when not pyqtdeployed, but I understand that is now not
> recommended.
> 
> A nieve pyqtdeploy to iOS fails to find the qml, its looking in
> '///private/var/mobile/Applications/randomDigitsHere/myApp.app/://resources/qml/Document.qml'
> I'm not sure that is the notation that means Qt is looking in its rcc
> compiled data in the executable file.  Besides, I don't see that the
> generated myApp.pro references myApp.qrc (shouldn't there be a
> 'resources+=myApp.qrc' ?)
> 
> I'm using Xcode, not QtCreator, directly after running pyqtdeploy, and
> the xcodeproj doesn't seem to have a step to move the resources into
> the app bundle.
> 
> Maybe myApp.qrc is not where pyqtdeploy can find it?  Or is there a
> step I am missing, such as fixing the .pro file and rerunning qmake?

Don't use rcc or pyrcc, see...

http://pyqt.sourceforge.net/Docs/pyqtdeploy/pyrcc.html

...and use the same technique for specifying the QML file URL.

Phil


More information about the PyQt mailing list