TreeFrogFramework
2.8
src
tbackgroundprocesshandler.h
Go to the documentation of this file.
1
#pragma once
2
#include <QProcess>
3
#include <TDatabaseContext>
4
#include <TGlobal>
5
6
class
TBackgroundProcess
;
7
8
9
class
T_CORE_EXPORT
TBackgroundProcessHandler
:
public
QObject,
public
TDatabaseContext
{
10
Q_OBJECT
11
public
:
12
TBackgroundProcessHandler
(QObject *parent =
nullptr
);
13
virtual
~TBackgroundProcessHandler
() { }
14
15
bool
autoDelete()
const
;
16
void
setAutoDelete(
bool
autoDelete);
17
TBackgroundProcess
*
backgroundProcess
()
const
{
return
_process; }
18
19
protected
slots:
20
virtual
void
handleFinished
(
int
exitCode, QProcess::ExitStatus exitStatus) = 0;
21
virtual
void
handleReadyReadStandardError
() { }
22
virtual
void
handleReadyReadStandardOutput
() { }
23
virtual
void
handleStarted
() { }
24
virtual
void
handleStateChanged
(QProcess::ProcessState) { }
25
26
#if QT_VERSION >= 0x050600
27
virtual
void
handleErrorOccurred
(QProcess::ProcessError)
28
{
29
}
30
#endif
31
32
void
deleteAutoDeleteHandler();
33
34
private
:
35
TBackgroundProcess
*_process {
nullptr
};
36
bool
_autoDelete {
true
};
37
38
friend
class
TBackgroundProcess
;
39
T_DISABLE_COPY
(
TBackgroundProcessHandler
)
40
T_DISABLE_MOVE
(
TBackgroundProcessHandler
)
41
};
42
TBackgroundProcessHandler
The TBackgroundProcessHandler class is used to handle events of a backgound process.
Definition:
tbackgroundprocesshandler.h:9
TBackgroundProcessHandler::handleStarted
virtual void handleStarted()
Definition:
tbackgroundprocesshandler.h:23
TBackgroundProcessHandler::backgroundProcess
TBackgroundProcess * backgroundProcess() const
Definition:
tbackgroundprocesshandler.h:17
TBackgroundProcessHandler::handleReadyReadStandardError
virtual void handleReadyReadStandardError()
Definition:
tbackgroundprocesshandler.h:21
TBackgroundProcessHandler::~TBackgroundProcessHandler
virtual ~TBackgroundProcessHandler()
Definition:
tbackgroundprocesshandler.h:13
TBackgroundProcessHandler::handleErrorOccurred
virtual void handleErrorOccurred(QProcess::ProcessError)
Definition:
tbackgroundprocesshandler.h:27
TBackgroundProcessHandler::handleStateChanged
virtual void handleStateChanged(QProcess::ProcessState)
Definition:
tbackgroundprocesshandler.h:24
TBackgroundProcessHandler::handleReadyReadStandardOutput
virtual void handleReadyReadStandardOutput()
Definition:
tbackgroundprocesshandler.h:22
TBackgroundProcessHandler::handleFinished
virtual void handleFinished(int exitCode, QProcess::ExitStatus exitStatus)=0
TBackgroundProcess
The TBackgroundProcess class is used to start external programs in background.
Definition:
tbackgroundprocess.h:7
TDatabaseContext
The TDatabaseContext class is the base class of contexts for database access.
Definition:
tdatabasecontext.h:11
T_CORE_EXPORT
#define T_CORE_EXPORT
Definition:
tdeclexport.h:28
T_DISABLE_COPY
#define T_DISABLE_COPY(Class)
Definition:
tdeclexport.h:37
T_DISABLE_MOVE
#define T_DISABLE_MOVE(Class)
Definition:
tdeclexport.h:41