summaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_1129.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtGui/bug_1129.py')
-rw-r--r--tests/QtGui/bug_1129.py33
1 files changed, 33 insertions, 0 deletions
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()