PyQt Access Violations

gregarican greg.kujawa at gmail.com
Sat Jan 7 08:06:54 EST 2006


I noticed that when I invoked the setCentralWidget() method using PyQt
3.13 on Python 2.3.5 opening and closing a widget associated with a
main window would result in a Win32 access violation crash after a
couple of times. Here's a generic snippet:

class Application_Window(QMainWindow):
     def __init__(self):
          QMainWindow.__init__(self,None,'application main
window',Qt.WDestructiveClose)

     def other_widget(self):
          self.this_widget=QWidget()
          self.setCentralWidget(self.this_widget)


The only way I could avoid the crashes was to replace the
setCentralWidget() method with:

          self.this_widget.show()

Is there some fundamental error I was making in this, or is this a
known bug?




More information about the Python-list mailing list