TreeFrogFramework  1.18
tbackgroundprocess.h
Go to the documentation of this file.
1 #ifndef TBACKGROUNDPROCESS_H
2 #define TBACKGROUNDPROCESS_H
3 
4 #include <QProcess>
5 #include <TGlobal>
6 #include <TBackgroundProcessHandler>
7 
8 
9 class T_CORE_EXPORT TBackgroundProcess : public QProcess
10 {
11  Q_OBJECT
12 public:
13  TBackgroundProcess(QObject *parent = nullptr);
14  virtual ~TBackgroundProcess() {}
15 
16  void start(const QString &program, const QStringList &arguments, OpenMode mode = ReadWrite, TBackgroundProcessHandler *handler = nullptr);
17  void start(const QString &command, OpenMode mode = ReadWrite, TBackgroundProcessHandler *handler = nullptr);
18  void start(OpenMode mode = ReadWrite, TBackgroundProcessHandler *handler = nullptr);
19  bool autoDelete() const;
20  void setAutoDelete(bool autoDelete);
21 
22 protected slots:
23  void callStart(const QString &program, const QStringList &arguments, int mode);
24  void handleFinished();
25 
26 private:
27  void connectToSlots(TBackgroundProcessHandler *handler);
28 
29  bool _autoDelete {true};
30 
33 };
34 
35 #endif // BACKGROUNDPROCESS_H
#define T_CORE_EXPORT
Definition: tglobal.h:81
#define T_DISABLE_COPY(Class)
Definition: tglobal.h:137
#define T_DISABLE_MOVE(Class)
Definition: tglobal.h:141
virtual ~TBackgroundProcess()
Definition: tbackgroundprocess.h:14
The TBackgroundProcessHandler class is used to handle events of a backgound process.
Definition: tbackgroundprocesshandler.h:11
The TBackgroundProcess class is used to start external programs in background.
Definition: tbackgroundprocess.h:9