[PyQt] QGraphicsScene problem
amagee at gmail.com
Mon Jul 2 06:01:29 BST 2007
Hello all. I've been playing around with pyqt 4 for a while but I've
run into a problem retrieving items from a QGraphicsScene's items
collection; the items returned seem to be garbage and cause the python
interpreter to segfault when I try to execute methods from them.
I can't seem to find any workaround that will let me find out what
item in the scene was clicked from a mouse event - does anyone have
any ideas about that?
Here's the simplest program I could come up with to reproduce the
problem. I'm guessing this is a bug in pyqt but I don't really know
much about it.
from PyQt4 import QtCore, QtGui
def __init__(self, parent = None):
a = QtGui.QGraphicsTextItem()
b = QtGui.QGraphicsTextItem()
# prints <class 'PyQt4.QtGui.QGraphicsTextItem'> as expected
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
window = QtGui.QGraphicsView()
scene = CalendarScene()
More information about the PyQt