I wrote python application using svg images as icons.
QtGui.QIcon(':icons/icon.svg') <- just like this
it works on my comuter but after compiling it with py2exe and running on another computer, theres no icons. if i try e.g. bmp format, all works fine. so i think it could be some library problem. I don't know what PyQt4 uses for svg graphics.
in setup.py file i wrote
dllList = ('mfc90.dll','msvcp90.dll','qtnetwork.pyd','qtxmlpatterns4.dll', 'qsvg4.dll', 'qsvgd4.dll')
origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
if os.path.basename(pathname).lower() in dllList:
return 0
return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL
setup(windows=[{"script" : "myApp.py"}], options={"py2exe" : {"includes" : ["sip", "PyQt4.QtNetwork", "PyQt4.QtWebKit", "PyQt4.QtSvg" ]}})
and also have imageformats folder (with qvg4.dll etc.) included in myApp.exe directory
so how solve this problem?
thanks, jarek
The
qsvg
plugin requiresQtXml
. Add"PyQt4.QtXml"
to your includes.Also see library dependencies in Qt.
You have to add a
qt.conf
in your application's main installation directory (actually, the application's working directory), containing:So the directory layout is:
And then in this case, the directory in
qt.conf
isplugins
.The plugin used (Qt 4.6) is:
You still need qt.conf as Ivo explained.