83 struct execQueueItem {
117 QQueue<execQueueItem> m_execQueue;
121 void startProcess(
const QString &app,
const QStringList &args);
122 static void startProcessBlocking(QProcess &internal,
const QString &app,
123 const QStringList &args);
126 explicit Executor(QObject *parent =
nullptr);
128 void execute(
int id,
const QString &app,
const QStringList &args,
129 bool readStdout,
bool readStderr =
true);
131 void execute(
int id,
const QString &workDir,
const QString &app,
132 const QStringList &args,
bool readStdout,
133 bool readStderr =
true);
135 void execute(
int id,
const QString &app,
const QStringList &args,
136 QString input = QString(),
bool readStdout =
false,
137 bool readStderr =
true);
139 void execute(
int id,
const QString &workDir,
const QString &app,
140 const QStringList &args, QString input = QString(),
141 bool readStdout =
false,
bool readStderr =
true);
144 const QString &input = QString(),
145 QString *process_out =
nullptr,
146 QString *process_err =
nullptr) -> int;
149 QString *process_out,
150 QString *process_err =
nullptr) -> int;
153 const QStringList &args,
154 QString *process_out =
nullptr,
155 QString *process_err =
nullptr) -> int;
161 void finished(
int exitCode, QProcess::ExitStatus exitStatus);
171 void finished(
int id,
int exitCode,
const QString &output,
172 const QString &errout);
186 void error(
int id,
int exitCode,
const QString &output,
187 const QString &errout);
static auto executeBlocking(QString app, const QStringList &args, const QString &input=QString(), QString *process_out=nullptr, QString *process_err=nullptr) -> int
Executor::executeBlocking blocking version of the executor, takes input and presents it as stdin.
void execute(int id, const QString &app, const QStringList &args, bool readStdout, bool readStderr=true)
Executor::execute execute an app.
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)
Executor::Executor executes external applications.
void setEnvironment(const QStringList &env)
Executor::setEnvironment set environment variables for executor processes.
void finished(int id, int exitCode, const QString &output, const QString &errout)
finished signal that is emited when process finishes
void starting()
starting signal that is emited when process starts
auto cancelNext() -> int
Executor::cancelNext cancels execution of first process in queue if it's not already running.