Apologies, typo, the added lines should read:

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


On 14/11/2012 12:57, James Goss wrote:

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(<
/span>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=<
/span>  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

|

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to