[PyQt] Problems with pyInstaller 2.0 and qt setWindowIcon Command

James Goss jamesgoss2 at googlemail.com
Wed Nov 14 12:57:05 GMT 2012


Hi All,


Wondering if anyone can help,

Simple Qt Application:

|from  PyQt4  import  QtGui,  QtCore
import  sys,  atexit

class  ApplicationWindow(QtGui.QMainWindow):
     def  __init__(self):
         QtGui.QMainWindow.__init__(self)
         self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
         self.setWindowTitle("application main window")
         self.file_menu=  QtGui.QMenu('&File',  self)
         self.menuBar().addMenu(self.file_menu)
         self.menuBar().addSeparator()

         self.main_widget=  QtGui.QWidget(self)

qApp=  QtGui.QApplication(sys.argv)
aw=  ApplicationWindow()    
aw.show()
sys.exit(qApp.exec_())
qApp.exec_()|

Run's without a problem and I can build an exe using pyInstaller which 
also runs fine.

I add the lines:

|iconfile=  QtGui.QIcon('C:/pyinstaller/img/image1.png')
aw.setWindowIcon()  |

Just before aw.show() (also tried in other places throughout the code)

This run's fine as a python file but when built using pyInstaller the 
exe crashes at run-time, I've tried using resource files and other image 
formats but the problem remains.

Can anyone help?

Thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121114/8f3a362e/attachment-0001.html>


More information about the PyQt mailing list