27 struct execQueueItem {
61 QQueue<execQueueItem> m_execQueue;
65 void startProcess(
const QString &app,
const QStringList &args);
66 static void startProcessBlocking(QProcess &internal,
const QString &app,
67 const QStringList &args);
84 void execute(
int id,
const QString &app,
const QStringList &args,
85 bool readStdout,
bool readStderr =
true);
96 void execute(
int id,
const QString &workDir,
const QString &app,
97 const QStringList &args,
bool readStdout,
98 bool readStderr =
true);
109 void execute(
int id,
const QString &app,
const QStringList &args,
110 QString input = QString(),
bool readStdout =
false,
111 bool readStderr =
true);
123 void execute(
int id,
const QString &workDir,
const QString &app,
124 const QStringList &args, QString input = QString(),
125 bool readStdout =
false,
bool readStderr =
true);
137 const QString &input = QString(),
138 QString *process_out =
nullptr,
139 QString *process_err =
nullptr) -> int;
150 QString *process_out,
151 QString *process_err =
nullptr) -> int;
163 const QStringList &args,
164 QString *process_out =
nullptr,
165 QString *process_err =
nullptr) -> int;
184 void finished(
int exitCode, QProcess::ExitStatus exitStatus);
194 void finished(
int id,
int exitCode, const QString &output,
195 const QString &errout);
209 void error(
int id,
int exitCode, const QString &output,
210 const QString &errout);
static auto executeBlocking(const QStringList &env, const QString &app, const QStringList &args, QString *process_out=nullptr, QString *process_err=nullptr) -> int
Run a command synchronously with a custom environment.
void execute(int id, const QString &workDir, const QString &app, const QStringList &args, bool readStdout, bool readStderr=true)
Queue a command with an explicit working directory.
auto environment() const -> QStringList
Return the environment passed to child processes.
void execute(int id, const QString &app, const QStringList &args, bool readStdout, bool readStderr=true)
Queue a command without stdin input.
void error(int id, int exitCode, const QString &output, const QString &errout)
error signal that is emited when process finishes with an error
Executor(QObject *parent=nullptr)
Construct an Executor with an optional parent QObject.
void setEnvironment(const QStringList &env)
Set the environment passed to all child processes.
static auto executeBlocking(const QString &app, const QStringList &args, const QString &input=QString(), QString *process_out=nullptr, QString *process_err=nullptr) -> int
Run a command synchronously and return its exit code.
void starting()
starting signal that is emited when process starts
static auto executeBlocking(const QString &app, const QStringList &args, QString *process_out, QString *process_err=nullptr) -> int
Run a command synchronously capturing stdout and stderr.
void execute(int id, const QString &app, const QStringList &args, QString input=QString(), bool readStdout=false, bool readStderr=true)
Queue a command with optional stdin input.
auto cancelNext() -> int
Cancel the next queued command without executing it.
void execute(int id, const QString &workDir, const QString &app, const QStringList &args, QString input=QString(), bool readStdout=false, bool readStderr=true)
Queue a command with working directory and optional stdin input.