Forward QThread's finished signal in GenericThread

This commit is contained in:
Atlante45 2015-12-15 16:30:31 -08:00
parent 346c28f9e2
commit 562d9ac2de

View file

@ -38,9 +38,10 @@ void GenericThread::initialize(bool isThreaded, QThread::Priority priority) {
_thread->setObjectName(objectName());
// when the worker thread is started, call our engine's run..
connect(_thread, SIGNAL(started()), this, SLOT(threadRoutine()));
connect(_thread, &QThread::started, this, &GenericThread::threadRoutine);
connect(_thread, &QThread::finished, this, &GenericThread::finished);
this->moveToThread(_thread);
moveToThread(_thread);
// Starts an event loop, and emits _thread->started()
_thread->start();
@ -82,5 +83,4 @@ void GenericThread::threadRoutine() {
if (_isThreaded && _thread) {
_thread->quit();
}
emit finished();
}