[PyKDE] The strangest problem I've ever seen

Willi Richert mennosimons at gmx.net
Mon Jul 1 22:22:00 BST 2002


Hi,

look at the following code which returns segfault when it exits.

####################################################
from qt import *
import sys

class MyWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)

        self.Toolbar = QToolBar("",self,Qt.DockTop)


def main(args):
    a=QApplication(args)
    w=MyWindow()
    w.show()
    QObject.connect(a, SIGNAL("lastWindowClosed()"), a, SLOT("quit()"))
    a.exec_loop()

if __name__ == "__main__":
    main(sys.argv)
####################################################

Now replace the variable "a" by any other name and it does segfault any more. 
Does anybody know, why?
Also, if I delete the toolbar line it works with "a" as the variable.

Thanks,
willi
-- 
Vieles ist einfach, der Rest zweifach.




More information about the PyQt mailing list