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