Remove usage of QThread in signal emission test

Reviewed by Anderson Lizardo (anderson.lizardo@openbossa.org)
This commit is contained in:
Lauro Neto 2009-12-28 17:35:03 -03:00
commit b38d83f8bd

View file

@ -6,7 +6,6 @@ import sys
import unittest import unittest
from PySide.QtCore import QObject, SIGNAL, SLOT, QProcess, QTimeLine from PySide.QtCore import QObject, SIGNAL, SLOT, QProcess, QTimeLine
from PySide.QtCore import QTimer, QThread
from helper import BasicPySlotCase, UsesQCoreApplication from helper import BasicPySlotCase, UsesQCoreApplication
@ -68,23 +67,17 @@ class CppSignalsToCppSlots(UsesQCoreApplication):
'''Connection between C++ slots and signals''' '''Connection between C++ slots and signals'''
def testWithoutArgs(self): def testWithoutArgs(self):
'''Connect QThread.started() to QTimeLine.togglePaused()''' '''Connect QProcess.started() to QTimeLine.togglePaused()'''
thread = QThread() process = QProcess()
timeline = QTimeLine() timeline = QTimeLine()
QObject.connect(thread, SIGNAL('started()'), QObject.connect(process, SIGNAL('finished(int, QProcess::ExitStatus)'),
timeline, SLOT('toggleDirection()')) timeline, SLOT('toggleDirection()'))
QObject.connect(thread, SIGNAL('started()'),
self.exit_app_cb)
orig_dir = timeline.direction() orig_dir = timeline.direction()
timer = QTimer.singleShot(1000, self.exit_app_cb) # Just for safety process.start(sys.executable, ['-c', '"print 42"'])
process.waitForFinished()
thread.start()
self.app.exec_()
thread.exit(0)
thread.wait()
new_dir = timeline.direction() new_dir = timeline.direction()