forked from treefrogframework/treefrog-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtbackgroundprocesshandler.h
More file actions
42 lines (32 loc) · 1.11 KB
/
Copy pathtbackgroundprocesshandler.h
File metadata and controls
42 lines (32 loc) · 1.11 KB
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
#pragma once
#include <QProcess>
#include <TDatabaseContext>
#include <TGlobal>
class TBackgroundProcess;
class T_CORE_EXPORT TBackgroundProcessHandler : public QObject, public TDatabaseContext {
Q_OBJECT
public:
TBackgroundProcessHandler(QObject *parent = nullptr);
virtual ~TBackgroundProcessHandler() { }
bool autoDelete() const;
void setAutoDelete(bool autoDelete);
TBackgroundProcess *backgroundProcess() const { return _process; }
protected slots:
virtual void handleFinished(int exitCode, QProcess::ExitStatus exitStatus) = 0;
virtual void handleReadyReadStandardError() { }
virtual void handleReadyReadStandardOutput() { }
virtual void handleStarted() { }
virtual void handleStateChanged(QProcess::ProcessState) { }
#if QT_VERSION >= 0x050600
virtual void handleErrorOccurred(QProcess::ProcessError)
{
}
#endif
void deleteAutoDeleteHandler();
private:
TBackgroundProcess *_process {nullptr};
bool _autoDelete {true};
friend class TBackgroundProcess;
T_DISABLE_COPY(TBackgroundProcessHandler)
T_DISABLE_MOVE(TBackgroundProcessHandler)
};