From b38d83f8bdd7e50cf29ceb43b671807a30d826aa Mon Sep 17 00:00:00 2001 From: Lauro Neto Date: Mon, 28 Dec 2009 17:35:03 -0300 Subject: Remove usage of QThread in signal emission test Reviewed by Anderson Lizardo (anderson.lizardo@openbossa.org) --- tests/signals/signal_emission_test.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'tests/signals') diff --git a/tests/signals/signal_emission_test.py b/tests/signals/signal_emission_test.py index 9c9f6139a..4fcdbe1e4 100644 --- a/tests/signals/signal_emission_test.py +++ b/tests/signals/signal_emission_test.py @@ -6,7 +6,6 @@ import sys import unittest from PySide.QtCore import QObject, SIGNAL, SLOT, QProcess, QTimeLine -from PySide.QtCore import QTimer, QThread from helper import BasicPySlotCase, UsesQCoreApplication @@ -68,23 +67,17 @@ class CppSignalsToCppSlots(UsesQCoreApplication): '''Connection between C++ slots and signals''' def testWithoutArgs(self): - '''Connect QThread.started() to QTimeLine.togglePaused()''' - thread = QThread() + '''Connect QProcess.started() to QTimeLine.togglePaused()''' + process = QProcess() timeline = QTimeLine() - QObject.connect(thread, SIGNAL('started()'), + QObject.connect(process, SIGNAL('finished(int, QProcess::ExitStatus)'), timeline, SLOT('toggleDirection()')) - QObject.connect(thread, SIGNAL('started()'), - self.exit_app_cb) orig_dir = timeline.direction() - timer = QTimer.singleShot(1000, self.exit_app_cb) # Just for safety - - thread.start() - self.app.exec_() - thread.exit(0) - thread.wait() + process.start(sys.executable, ['-c', '"print 42"']) + process.waitForFinished() new_dir = timeline.direction() -- cgit v1.2.3