OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
processinvoker.hpp
Go to the documentation of this file.
1 #ifndef PROCESSINVOKER_HPP
2 #define PROCESSINVOKER_HPP
3 
4 #include <QStringList>
5 #include <QString>
6 #include <QProcess>
7 
8 namespace Process
9 {
10  class ProcessInvoker : public QObject
11  {
12  Q_OBJECT
13 
14  public:
15 
18 
19 // void setProcessName(const QString &name);
20 // void setProcessArguments(const QStringList &arguments);
21 
22  QProcess* getProcess();
23 // QString getProcessName();
24 // QStringList getProcessArguments();
25 
26 // inline bool startProcess(bool detached = false) { return startProcess(mName, mArguments, detached); }
27  inline bool startProcess(const QString &name, bool detached = false) { return startProcess(name, QStringList(), detached); }
28  bool startProcess(const QString &name, const QStringList &arguments, bool detached = false);
29 
30  private:
31  QProcess *mProcess;
32 
33  QString mName;
34  QStringList mArguments;
35 
36  private slots:
37  void processError(QProcess::ProcessError error);
38  void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
39 
40  };
41 }
42 
43 #endif // PROCESSINVOKER_HPP
ProcessInvoker()
Definition: processinvoker.cpp:12
bool startProcess(const QString &name, bool detached=false)
Definition: processinvoker.hpp:27
Definition: processinvoker.hpp:10
QString mName
Definition: processinvoker.hpp:33
QProcess * mProcess
Definition: processinvoker.hpp:31
QStringList mArguments
Definition: processinvoker.hpp:34
void processError(QProcess::ProcessError error)
Definition: processinvoker.cpp:154
QProcess * getProcess()
Definition: processinvoker.cpp:41
~ProcessInvoker()
Definition: processinvoker.cpp:27
void processFinished(int exitCode, QProcess::ExitStatus exitStatus)
Definition: processinvoker.cpp:168
const char * name
Definition: crashcatcher.cpp:59