summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-15 19:05:02 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2011-02-15 19:35:05 -0200
commit691841f829a87b3e9d765f9b41c360ca275991ad (patch)
treef3388b70be76f60d7df34dd4abe3cf81a9823457
parent47957530f9140081da3bbf3db040e3ecce523256 (diff)
downloadpyside-691841f829a87b3e9d765f9b41c360ca275991ad.tar.gz
pyside-691841f829a87b3e9d765f9b41c360ca275991ad.tar.xz
pyside-691841f829a87b3e9d765f9b41c360ca275991ad.zip
Fix bug 675 - "QGraphicsLinearLayout segfault"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml10
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_675.py15
3 files changed, 22 insertions, 4 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 21dc5d3..b7b2873 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3083,9 +3083,11 @@
</modify-function>
<modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
- <modify-argument index="return">
- <parent index="this" action="add" />
- </modify-argument>
+ <!-- TODO: Add a keeper attribute to reference-count tag to do what this inject code do. -->
+ <inject-code>
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(%1, %2));
+ Shiboken::Object::keepReference((SbkObject*)%PYARG_0, "setWidget(QWidget*)1", %PYARG_1);
+ </inject-code>
</modify-function>
<!-- use glue code -->
@@ -5062,7 +5064,7 @@
</modify-function>
<modify-function signature="setWidget(QWidget*)">
<modify-argument index="1">
- <parent index="this" action="add"/>
+ <reference-count action="set"/>
</modify-argument>
</modify-function>
</object-type>
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index d22c67e..1c10e5c 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -39,6 +39,7 @@ PYSIDE_TEST(bug_660.py)
PYSIDE_TEST(bug_662.py)
PYSIDE_TEST(bug_667.py)
PYSIDE_TEST(bug_668.py)
+PYSIDE_TEST(bug_675.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_675.py b/tests/QtGui/bug_675.py
new file mode 100644
index 0000000..d490f0f
--- /dev/null
+++ b/tests/QtGui/bug_675.py
@@ -0,0 +1,15 @@
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+app = QApplication([])
+
+scene = QGraphicsScene()
+
+# don't segfault due to lack of keepReferenceCall
+textEdit = scene.addWidget(QTextEdit())
+
+layout = QGraphicsLinearLayout()
+layout.addItem(textEdit)
+
+view = QGraphicsView(scene)
+view.show()