An abstract subclass of Task that runs an external command (a subprocess).
More...
#include <ExternalCommandTask.h++>
An abstract subclass of Task that runs an external command (a subprocess).
Subclasses must provide a suitable constructor and may optionally override processStandardOutput(), processStandardError(), and finish().
- Author
- Mark Lindner
◆ ~ExternalCommandTask()
◆ ExternalCommandTask()
◆ args()
QStringList args |
( |
| ) |
const |
|
inline |
Returns the arguments to the executable.
◆ cancel()
Specified by Task.
Reimplemented from Task.
◆ cancelled
Emitted when the task has been cancelled.
◆ error()
Returns the error message reported by this task upon failure, if any.
◆ executable()
QString executable |
( |
| ) |
const |
|
inline |
Returns the path to the executable that will be run.
◆ execute()
◆ executionTime()
qint64 executionTime |
( |
| ) |
const |
|
inherited |
Returns the amount of time the task spent executing, or 0 if the task has not finished executing.
◆ exitCode()
Returns the exit code from the subprocess.
◆ fail()
void fail |
( |
QString |
error = QString() | ) |
|
|
protectedinherited |
Marks the task as failed, with an optional error message.
◆ finish()
Called when the process has exited and just before the finished() signal is emitted.
May be overridden to perform any necessary cleanup tasks. The default implementation is a no-op.
◆ finished
Emitted when the task has finished executing.
◆ id()
Returns the unique ID that was assigned to this task.
◆ isBackground()
bool isBackground |
( |
| ) |
const |
|
inlineinherited |
Tests if the task is a background task.
◆ isCancelled()
bool isCancelled |
( |
| ) |
const |
|
inlineinherited |
Tests if the task has been cancelled.
◆ isCancelling()
bool isCancelling |
( |
| ) |
const |
|
inlineinherited |
Tests if the task is currently cancelling.
◆ isFailed()
Tests if the task has failed.
◆ isRunning()
Tests if the task is currently executing.
◆ processStandardError()
virtual void processStandardError |
( |
QString |
text | ) |
|
|
protectedvirtual |
Called to process standard error from the process.
The default implementation is a no-op.
◆ processStandardOutput()
virtual void processStandardOutput |
( |
QString |
text | ) |
|
|
protectedvirtual |
Called to process standard output from the process.
The default implementation is a no-op.
◆ setArgs()
void setArgs |
( |
QStringList |
args | ) |
|
|
protected |
Sets the command line arguments for the executable.
◆ setCancelled()
Marks the task as cancelled.
◆ setTimeout()
void setTimeout |
( |
int |
seconds | ) |
|
|
inherited |
Sets the task's timeout, in seconds.
◆ setUnbufferedOutput()
void setUnbufferedOutput |
( |
bool |
unbufferedOutput | ) |
|
|
inlineprotected |
Specifies whether the command's output will be unbuffered.
If the output is unbuffered, it will be passed to the processStandardOutput() and processStandardError() methods as it arrives; otherwise, it will be buffered internally and passed to these methods when the subprocess has finished executing. By default, output is buffered.
◆ statusUpdated
void statusUpdated |
( |
const QString & |
status | ) |
|
|
signalinherited |
◆ toString()
QString toString |
( |
| ) |
const |
Returns a string representation of the task.
◆ updateStatus()
void updateStatus |
( |
const QString & |
text | ) |
|
|
protectedinherited |
◆ DEFAULT_TIMEOUT
const int DEFAULT_TIMEOUT |
|
staticinherited |
The default timeout interval, in seconds.
The documentation for this class was generated from the following file: