5#ifndef TASKING_QPROCESSTASK_H
6#define TASKING_QPROCESSTASK_H
23#include <QtCore/QProcess>
54class TASKING_EXPORT QProcessDeleter
58 static void deleteAll();
59 void operator()(QProcess *process);
62class TASKING_EXPORT QProcessAdapter :
public TaskAdapter<QProcess, QProcessDeleter>
66 connect(task(), &QProcess::finished,
this, [
this] {
67 const bool success = task()->exitStatus() == QProcess::NormalExit
68 && task()->error() == QProcess::UnknownError
69 && task()->exitCode() == 0;
70 Q_EMIT done(toDoneResult(success));
72 connect(task(), &QProcess::errorOccurred,
this, [
this](QProcess::ProcessError error) {
73 if (error != QProcess::FailedToStart)
75 Q_EMIT done(DoneResult::Error);
81using QProcessTask = CustomTask<QProcessAdapter>;