Fix bug 844 - "Crash in QGraphicsItem::toGraphicsObject when printing obj reference"

Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
          Renato Araújo <renato.filho@openbossa.org>
This commit is contained in:
Hugo Parente Lima 2011-05-03 15:03:44 -03:00
commit 9b793705fe
3 changed files with 21 additions and 1 deletions

View file

@ -6428,7 +6428,7 @@
<object-type name="QGraphicsEffectSource"/>
-->
<object-type name="QGraphicsObject" polymorphic-id-expression="qgraphicsitem_cast&lt;QGraphicsObject*>(%1)" />
<object-type name="QGraphicsObject" />
<object-type name="QGraphicsOpacityEffect"/>
<object-type name="QGraphicsRotation"/>
<object-type name="QGraphicsScale"/>

View file

@ -55,6 +55,7 @@ PYSIDE_TEST(bug_778.py)
PYSIDE_TEST(bug_793.py)
PYSIDE_TEST(bug_811.py)
PYSIDE_TEST(bug_836.py)
PYSIDE_TEST(bug_844.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)

19
tests/QtGui/bug_844.py Normal file
View file

@ -0,0 +1,19 @@
from PySide.QtGui import *
from PySide.QtCore import *
class QtKeyPressListener(QObject):
def __init__(self, obj):
QObject.__init__(self)
obj.installEventFilter(self)
self.fConnections = {}
def eventFilter(self, obj, event):
# This used to crash here due to a misbehaviour of type discovery!
return QObject.eventFilter(self, obj, event)
app = QApplication([])
key_listener = QtKeyPressListener(app)
w = QLabel('Hello')
w.show()
QTimer.singleShot(0, w.close)
app.exec_()