aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2011-12-05 15:10:48 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:56:17 -0300
commit2f70b1047116fa262b30562f325dfaefff3daa0d (patch)
tree1519213b29e39c22a6fce72002a729d6a966ecc0 /tests
parente2524f6abb6c00695edce5be26a7d6fc7b71c5fe (diff)
Fix BUG #1077 - "Application exit crash when call QSyntaxHighlighter.document()"
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_1077.py17
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index acb9a67ee..1d95576f5 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -80,6 +80,7 @@ PYSIDE_TEST(bug_998.py)
PYSIDE_TEST(bug_1002.py)
PYSIDE_TEST(bug_1006.py)
PYSIDE_TEST(bug_1048.py)
+PYSIDE_TEST(bug_1077.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(event_filter_test.py)
diff --git a/tests/QtGui/bug_1077.py b/tests/QtGui/bug_1077.py
new file mode 100644
index 000000000..231ce1e04
--- /dev/null
+++ b/tests/QtGui/bug_1077.py
@@ -0,0 +1,17 @@
+''' unit test for BUG #1077 '''
+
+from PySide import QtCore, QtGui
+import time
+
+class Highlighter(QtGui.QSyntaxHighlighter):
+ def __init__(self, parent, mode):
+ QtGui.QSyntaxHighlighter.__init__(self, parent)
+ self.tstamp = time.time()
+
+if __name__ == "__main__":
+ app = QtGui.QApplication([])
+ python = QtGui.QTextEdit()
+ python.setWindowTitle("python")
+ hl = Highlighter(python.document(), "python")
+ python.show()
+ text = hl.document()