summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()