Runnable 1.6 instances!
This commit is contained in:
parent
005a010ee6
commit
183a735145
23 changed files with 502 additions and 214 deletions
|
@ -16,7 +16,7 @@
|
|||
#include "Task.h"
|
||||
|
||||
Task::Task(QObject *parent) :
|
||||
QThread(parent)
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -49,29 +49,31 @@ void Task::setProgress(int progress)
|
|||
}
|
||||
|
||||
void Task::startTask()
|
||||
{
|
||||
start();
|
||||
}
|
||||
|
||||
void Task::run()
|
||||
{
|
||||
emitStarted();
|
||||
executeTask();
|
||||
emitEnded();
|
||||
}
|
||||
|
||||
void Task::emitStarted()
|
||||
{
|
||||
running = true;
|
||||
emit started();
|
||||
emit started(this);
|
||||
}
|
||||
|
||||
void Task::emitEnded()
|
||||
{
|
||||
running = false;
|
||||
emit ended();
|
||||
emit ended(this);
|
||||
}
|
||||
|
||||
bool Task::isRunning() const
|
||||
{
|
||||
return running;
|
||||
}
|
||||
|
||||
|
||||
void Task::emitStatusChange(const QString &status)
|
||||
{
|
||||
emit statusChanged(status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue