summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-08 15:52:02 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:56 -0300
commit3c31d96eed51265fd769235d365c27e45b2c66ca (patch)
tree8970b9dc41f336f057ffcd2c9551262ba8545540
parent280d68ca34debebfeb9172420598a15ba576eb7e (diff)
Fix bug 667 - "Crash on exit"
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml17
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_667.py24
3 files changed, 41 insertions, 1 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 2227103a..a0e675af 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2830,9 +2830,24 @@
<modify-function signature="setupViewport(QWidget *)" access="non-final"/>
<modify-function signature="setScene(QGraphicsScene*)">
<modify-argument index="1">
- <parent index="this" action="add"/>
+ <reference-count action="add"/>
</modify-argument>
</modify-function>
+ <modify-function signature="scene()const">
+ <modify-argument index="return">
+ <define-ownership owner="default"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="itemAt(int,int)const">
+ <modify-argument index="return">
+ <define-ownership owner="default"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="itemAt(QPoint)const">
+ <modify-argument index="return">
+ <define-ownership owner="default"/>
+ </modify-argument>
+ </modify-function>
<modify-function signature="drawBackground(QPainter*,QRectF)">
<modify-argument index="1" invalidate-after-use="yes"/>
</modify-function>
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 7724377a..dd24a86d 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -36,6 +36,7 @@ PYSIDE_TEST(bug_652.py)
PYSIDE_TEST(bug_653.py)
PYSIDE_TEST(bug_660.py)
PYSIDE_TEST(bug_662.py)
+PYSIDE_TEST(bug_667.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_667.py b/tests/QtGui/bug_667.py
new file mode 100644
index 00000000..40c8d64a
--- /dev/null
+++ b/tests/QtGui/bug_667.py
@@ -0,0 +1,24 @@
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+class Ball(QGraphicsEllipseItem):
+ def __init__(self, d, parent=None):
+ super(Ball, self).__init__(0, 0, d, d, parent)
+ self.vel = QPointF(0,0) #commenting this out prevents the crash
+
+class Foo(QGraphicsView):
+ def __init__(self):
+ super(Foo, self).__init__(None)
+ self.scene = QGraphicsScene(self.rect())
+ self.setScene(self.scene)
+ self.scene.addItem(Ball(10))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QApplication(sys.argv)
+ w = Foo()
+ w.show()
+ w.raise_()
+ QTimer.singleShot(0, w.close)
+ sys.exit(app.exec_())