TreeFrogFramework
2.10
Loading...
Searching...
No Matches
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
virtual
void
handleErrorOccurred
(QProcess::ProcessError) { }
26
void
deleteAutoDeleteHandler();
27
28
private
:
29
TBackgroundProcess
*_process {
nullptr
};
30
bool
_autoDelete {
true
};
31
32
friend
class
TBackgroundProcess
;
33
T_DISABLE_COPY
(
TBackgroundProcessHandler
)
34
T_DISABLE_MOVE
(
TBackgroundProcessHandler
)
35
};
36
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::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:25
TBackgroundProcessHandler::backgroundProcess
TBackgroundProcess * backgroundProcess() const
Definition
tbackgroundprocesshandler.h:17
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