[PyQt] Problem loading qml when pyqtdeployed

bootch at nc.rr.com bootch at nc.rr.com
Fri Jan 9 17:19:21 GMT 2015

In short:

qmlUrl=QUrl.fromLocalFile(QFileInfo(__file__).path() + "/appPackage/qml/toolBar.qml")

doesn't work when pyqtdeployed, although it works when invoked from Python.  Also, I can load icons using similar construct (without wrapping in QUrl().  I don't see a way to load the quickview without calling QUrl() ).

The error from Qt is: 'file:///home/bootch/pensoolpyqtdeploy/:/appPackage/qml/toolBar.qml: File not found'
And qmlUrl.toString() is: 'file::/appPackage/qml/toolBar.qml'
both of which seem garbled to me.

I put a small example Eclipse project including the .pdy file at https://github.com/bootchk/testQmlFromResources.git

Another strangeness is that invoked from Python, for an icon '/images/foo.png' works but for qml '/qml/toolBar.qml' does not work. Only '/appPackage/qml/toolBar.qml' works, even though the qml and images directory are at the same level in the directory structure.

Environment: Ubuntu14.04, Qt5.4, Python3.4.2, the latest stable SIP, PyQt, pyqtdeploy

More information about the PyQt mailing list