summaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_1041.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtGui/bug_1041.py')
-rw-r--r--tests/QtGui/bug_1041.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/QtGui/bug_1041.py b/tests/QtGui/bug_1041.py
new file mode 100644
index 0000000..735bf73
--- /dev/null
+++ b/tests/QtGui/bug_1041.py
@@ -0,0 +1,35 @@
+''' unit test for BUG #1041 '''
+
+import sys
+from PySide.QtGui import *
+from PySide.QtCore import *
+
+class BugWindow(QMainWindow):
+ def __init__(self):
+ super(BugWindow, self).__init__()
+ self.setCentralWidget(QTableView())
+ self.timer = QTimer(self)
+ self.timer.timeout.connect(self.doTest)
+ self.timer.start(20)
+ self.count = 0
+
+ @Slot()
+ def doTest(self):
+ self.m = QStandardItemModel(1, 1, None)
+
+ try:
+ table = self.centralWidget()
+ table.setModel(self.m)
+ table.selectionModel()
+ except AttributeError:
+ sys.exit(-1)
+
+ if self.count >= 50:
+ QApplication.instance().quit()
+
+ self.count += 1
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ window = BugWindow()
+ sys.exit(app.exec_())