summaryrefslogtreecommitdiff
path: root/python/helpers/pydev/tests_python/_debugger_case_qthread1.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/helpers/pydev/tests_python/_debugger_case_qthread1.py')
-rw-r--r--python/helpers/pydev/tests_python/_debugger_case_qthread1.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/python/helpers/pydev/tests_python/_debugger_case_qthread1.py b/python/helpers/pydev/tests_python/_debugger_case_qthread1.py
new file mode 100644
index 000000000000..eb8729f13577
--- /dev/null
+++ b/python/helpers/pydev/tests_python/_debugger_case_qthread1.py
@@ -0,0 +1,25 @@
+import time
+import sys
+
+try:
+ from PySide import QtCore
+except:
+ from PyQt4 import QtCore
+
+# Subclassing QThread
+# http://doc.qt.nokia.com/latest/qthread.html
+class AThread(QtCore.QThread):
+
+ def run(self):
+ count = 0
+ while count < 5:
+ time.sleep(.5)
+ print("Increasing", count);sys.stdout.flush()
+ count += 1
+
+app = QtCore.QCoreApplication([])
+thread = AThread()
+thread.finished.connect(app.exit)
+thread.start()
+app.exec_()
+print('TEST SUCEEDED!') \ No newline at end of file