[PyQt] Problems with pyInstaller 2.0 and qt setWindowIcon Command

James Goss jamesgoss2 at googlemail.com
Wed Nov 14 13:01:21 GMT 2012


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
>
> |

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


More information about the PyQt mailing list