summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2012-01-27 16:39:01 -0300
committerPaulo Alcantara <pcacjr@gmail.com>2012-01-27 19:17:37 -0300
commita90f3bc3c3766ffe7d233c5f9e8512fef236c5a6 (patch)
tree06eae3c1678b28fbf61f9eadd1fc9f821ef0e68c
parent01694f57bbcdd3841b43bf0cc2df0cf2c7d5ab3f (diff)
downloadpyside-a90f3bc3c3766ffe7d233c5f9e8512fef236c5a6.tar.gz
pyside-a90f3bc3c3766ffe7d233c5f9e8512fef236c5a6.tar.xz
pyside-a90f3bc3c3766ffe7d233c5f9e8512fef236c5a6.zip
Fix BUG #1129 - "Segmentation fault on close by
QStandardItem/QStandardItemModel" See http://bugs.pyside.org/show_bug.cgi?id=1129. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewed-by: Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml5
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_1129.py33
3 files changed, 39 insertions, 0 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 965b69d..caf3570 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2675,6 +2675,11 @@
</modify-argument>
</modify-function>
+ <modify-function signature="model() const">
+ <modify-argument index="return">
+ <define-ownership owner="default"/>
+ </modify-argument>
+ </modify-function>
<!-- ??? -->
<modify-function signature="operator&lt;(QStandardItem)const" remove="all"/>
</object-type>
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 35c0aa6..da3b4b6 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -83,6 +83,7 @@ PYSIDE_TEST(bug_1041.py)
PYSIDE_TEST(bug_1048.py)
PYSIDE_TEST(bug_1077.py)
PYSIDE_TEST(bug_1124.py)
+PYSIDE_TEST(bug_1129.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(event_filter_test.py)
diff --git a/tests/QtGui/bug_1129.py b/tests/QtGui/bug_1129.py
new file mode 100644
index 0000000..565b779
--- /dev/null
+++ b/tests/QtGui/bug_1129.py
@@ -0,0 +1,33 @@
+''' unit test for BUG #1129 '''
+''' See http://bugs.pyside.org/show_bug.cgi?id=1129. '''
+
+from PySide import QtCore, QtGui
+from helper import UsesQApplication
+import unittest
+
+class Item(QtGui.QStandardItem):
+ def data(self, role):
+ if role == QtCore.Qt.DisplayRole:
+ return str(self.model())
+
+ return super(Item, self).data(role)
+
+class Window(QtGui.QMainWindow):
+ def __init__(self, parent=None):
+ super(Window, self).__init__(parent)
+
+ model = QtGui.QStandardItemModel(1, 1, self)
+ model.setItem(0, 0, Item())
+
+ self.setCentralWidget(QtGui.QTreeView(self))
+ self.centralWidget().setModel(model)
+
+ QtCore.QTimer.singleShot(0, self.raise_)
+
+class QStandardItemTestCase(UsesQApplication):
+ def testDataFunction(self):
+ w = Window()
+ w.show()
+
+if __name__ == "__main__":
+ unittest.main()