-
Notifications
You must be signed in to change notification settings - Fork 2
/
toolworker.h
48 lines (35 loc) · 907 Bytes
/
toolworker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef TOOLWORKER_H
#define TOOLWORKER_H
#include <QObject>
#include <QThread>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include "itool.h"
#include "toolsfabric.h"
class ToolWorker : public QThread
{
Q_OBJECT
public:
explicit ToolWorker(QObject *parent = nullptr);
~ToolWorker() override;
ToolWorker(const ToolWorker &);
ToolWorker &operator=(const ToolWorker &);
ToolWorker *setTaskJson(QJsonArray);
void setTaskName(QString);
protected:
void run() override;
private:
QJsonArray taskArray;
ITool *currentTool;
QString taskName;
signals:
void started(QString);
void newOutputData(QString, QByteArray line);
void newErrorData(QString, QByteArray line);
void finished(QString name, int exitCode, int exitStatus);
public slots:
void kill();
};
Q_DECLARE_METATYPE(ToolWorker)
#endif // TOOLWORKER_H