[PyQt] Re: QGraphicsWidget crash on exit

kib2 kib2 at free.fr
Tue Jul 22 11:10:59 BST 2008


Brian Kelley a écrit :
> I'm getting a crash on exit using QGraphicsWidget.  It appears to be in 
> the destructor for sipQGraphicsWidget.
> 
> Attached is the sample program.  I can't tell whether this is a bug in 
> PyQt or Qt, does anyone else have the same issue?
> 
> import sys
> from   PyQt4 import QtGui, QtCore
> from   PyQt4.QtCore import Qt
> 
> app = QtGui.QApplication(sys.argv)
> scene = QtGui.QGraphicsScene()
> scene.setSceneRect(0,0,100,100)
> vw = QtGui.QGraphicsView()
> vw.setScene(scene)
> vw.show()
> 
> label = QtGui.QLabel("foo")
> 
> p = scene.addWidget(label)
> lay = QtGui.QGraphicsLinearLayout()
> lay.addItem(p)
> w = QtGui.QGraphicsWidget()
> w.setLayout(lay)
> w.setContentsMargins(8,12,8,8)
> w.setFlag(QtGui.QGraphicsItem.ItemIsMovable)
> w.setFlag(QtGui.QGraphicsItem.ItemIsSelectable)
> 
> scene.addItem(w)
> 
> app.exec_()
> 
Hi Brian,

you sample if working fine for me on a Windows XP SP2 machine with 
PyQt4.4.3-20080612 snapshot .



More information about the PyQt mailing list