On Sunday 12 March 2006 9:52 pm, Gerard Vermeulen wrote: > Phil, > > this program: > > #!/usr/bin/env python > > import sys > import PyQt4.Qt as Qt > > class MyMainWindow(Qt.QMainWindow): > def __init__(self): > print type(Qt.Qt.WA_QuitOnClose) > # this type must be an alias for a WFlags, isn't it?? > Qt.QMainWindow.__init__(self, None, Qt.Qt.WA_QuitOnClose) > > if __name__ == '__main__': > app = Qt.QApplication(sys.argv) > demo = MyMainWindow() > demo.show() > > raises this exception: > > $ python bug.py > > Traceback (most recent call last): > File "bug.py", line 14, in ? > demo = MyMainWindow() > File "bug.py", line 10, in __init__ > Qt.QMainWindow.__init__(self, None, Qt.Qt.WA_QuitOnClose) > TypeError: argument 2 of QMainWindow() has an invalid type > > Am I doing something wrong? They are of different types. WA_QuitOnClose is an WidgetAttribute enum. Use QWidget.setAttribute() to set it. Phil _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde