From 71cd11a1c3b746b55c31bb818598f26a454992a4 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Tue, 3 May 2011 15:03:44 -0300 Subject: Fix bug 844 - "Crash in QGraphicsItem::toGraphicsObject when printing obj reference" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer: Marcelo Lira Renato Araújo --- tests/QtGui/CMakeLists.txt | 1 + tests/QtGui/bug_844.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/QtGui/bug_844.py (limited to 'tests') diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index ff0ce6895..db6b19c1c 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -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) diff --git a/tests/QtGui/bug_844.py b/tests/QtGui/bug_844.py new file mode 100644 index 000000000..e01d7eab0 --- /dev/null +++ b/tests/QtGui/bug_844.py @@ -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_() -- cgit v1.2.3