summaryrefslogtreecommitdiffstats
path: root/job.cpp
blob: 684cb711abcde07ba918a4987bb29e41d67b6db8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "job.h"
#include "video.h"
#include <QtConcurrentRun>

Job::Job(QObject *parent)
		: QObject(parent)
{
	m_watcher = new QFutureWatcher<bool>;
	m_watcher->setParent(this);
	connect(m_watcher, SIGNAL(finished()), this, SLOT(jobFinished()));
}
void Job::runJob()
{
	m_watcher->setFuture(QtConcurrent::run(this, &Job::executeJob));
}
void Job::jobFinished()
{
	emit completed(m_watcher->future().result());
}