[PyQt] core dumped when destructor is called

Vincent Vande Vyvre vincent.vandevyvre at swing.be
Fri Sep 14 18:56:54 BST 2012

Le 14/09/12 15:54, Louis Granboulan a écrit :
> I stumbled upon the following bug, which is probably a pyqt bug that
> did not exist in the previous version.
> You should be able to reproduce it on an up-to-date ubuntu with
> python-qt4 4.9.1-2ubuntu1
> The following code generates a SEGV, because the destructor for app is called
> import sys
> from PyQt4 import QtGui
> app = QtGui.QApplication(sys.argv)
> view = QtGui.QFrame(None)
> view.graphicsView = QtGui.QGraphicsView()
> view.graphicsView.setScene(QtGui.QGraphicsScene())
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
For me, it's always the case from vers. 4.5 to vers. 4.8.x.

Reimplement the closeEvent() of your MainWindow with
a call of  QtCore.QCoreApplication.processEvents() and the SEGV disappears.

Vincent V.V.
Oqapy <https://launchpad.net/oqapy> . Qarte
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>

More information about the PyQt mailing list