sneedmc/launcher/tasks/SequentialTask.h

31 lines
540 B
C
Raw Normal View History

#pragma once
#include "Task.h"
2021-11-20 16:08:34 +00:00
#include "QObjectPtr.h"
#include <QQueue>
class SequentialTask : public Task
{
2018-07-15 12:51:05 +00:00
Q_OBJECT
public:
2018-07-15 12:51:05 +00:00
explicit SequentialTask(QObject *parent = 0);
virtual ~SequentialTask() {};
2021-11-21 22:36:55 +00:00
void addTask(Task::Ptr task);
protected:
2018-07-15 12:51:05 +00:00
void executeTask();
private
slots:
2018-07-15 12:51:05 +00:00
void startNext();
void subTaskFailed(const QString &msg);
void subTaskStatus(const QString &msg);
void subTaskProgress(qint64 current, qint64 total);
private:
2021-11-21 22:36:55 +00:00
QQueue<Task::Ptr > m_queue;
2018-07-15 12:51:05 +00:00
int m_currentIndex;
};