TreeFrogFramework  2.8
tbackgroundprocesshandler.h
Go to the documentation of this file.
1 #pragma once
2 #include <QProcess>
3 #include <TDatabaseContext>
4 #include <TGlobal>
5 
7 
8 
10  Q_OBJECT
11 public:
12  TBackgroundProcessHandler(QObject *parent = nullptr);
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;
41 };
42 
The TBackgroundProcessHandler class is used to handle events of a backgound process.
Definition: tbackgroundprocesshandler.h:9
virtual void handleStarted()
Definition: tbackgroundprocesshandler.h:23
TBackgroundProcess * backgroundProcess() const
Definition: tbackgroundprocesshandler.h:17
virtual void handleReadyReadStandardError()
Definition: tbackgroundprocesshandler.h:21
virtual ~TBackgroundProcessHandler()
Definition: tbackgroundprocesshandler.h:13
virtual void handleErrorOccurred(QProcess::ProcessError)
Definition: tbackgroundprocesshandler.h:27
virtual void handleStateChanged(QProcess::ProcessState)
Definition: tbackgroundprocesshandler.h:24
virtual void handleReadyReadStandardOutput()
Definition: tbackgroundprocesshandler.h:22
virtual void handleFinished(int exitCode, QProcess::ExitStatus exitStatus)=0
The TBackgroundProcess class is used to start external programs in background.
Definition: tbackgroundprocess.h:7
The TDatabaseContext class is the base class of contexts for database access.
Definition: tdatabasecontext.h:11
#define T_CORE_EXPORT
Definition: tdeclexport.h:28
#define T_DISABLE_COPY(Class)
Definition: tdeclexport.h:37
#define T_DISABLE_MOVE(Class)
Definition: tdeclexport.h:41