Extending Qt Creator Manual | ShellCommand

Extending Qt Creator Manual 4.6.2

# ShellCommand Class

(Utils::ShellCommand)

- List of all members, including inherited members

## Public Types

enum | RunFlags { ShowStdOut, MergeOutputChannels, SuppressStdErr, SuppressFailMessage, ..., NoOutput }

## Public Functions

| ShellCommand(const QString &workingDirectory, const QProcessEnvironment &environment)
| ~ShellCommand() override
void | abort()
void | addFlags(unsigned f)
void | addJob(const FileName &binary, const QStringList &arguments, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter)
void | addJob(const FileName &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter)
void | cancel()
QTextCodec * | codec() const
const QVariant & | cookie() const
int | defaultTimeoutS() const
const QString & | defaultWorkingDirectory() const
QString | displayName() const
void | execute()
unsigned | flags() const
bool | hasProgressParser() const
int | lastExecutionExitCode() const
bool | lastExecutionSuccess() const
virtual const QProcessEnvironment | processEnvironment() const
virtual SynchronousProcessResponse | runCommand(const FileName &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter)
void | setCodec(QTextCodec *codec)
void | setCookie(const QVariant &cookie)
void | setDefaultTimeoutS(int timeout)
void | setDisplayName(const QString &name)
void | setOutputProxyFactory(const std::function<OutputProxy *() > &factory)
void | setProgressParser(ProgressParser *parser)
void | setProgressiveOutput(bool progressive)

## Signals

void | finished(bool ok, int exitCode, const QVariant &cookie)
void | stdErrText(const QString &)
void | stdOutText(const QString &)
void | success(const QVariant &cookie)
void | terminate()

## Protected Functions

virtual void | addTask(QFuture<void> &future)
virtual unsigned | processFlags() const
int | timeoutS() const
QString | workDirectory(const QString &wd) const

## Member Type Documentation

### enum ShellCommand::RunFlags

## Member Function Documentation

### ShellCommand::ShellCommand(const QString &workingDirectory, const QProcessEnvironment &environment)

Default constructs an instance of ShellCommand.

### ShellCommand::~ShellCommand()

Destroys the instance of ShellCommand.

### void ShellCommand::abort()

### void ShellCommand::addFlags(unsigned f)

### void ShellCommand::addJob(const FileName &binary, const QStringList &arguments, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter)

### void ShellCommand::addJob(const FileName &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter)

### `[virtual protected]` void ShellCommand::addTask(QFuture<void> &future)

### void ShellCommand::cancel()

### QTextCodec *ShellCommand::codec() const

See also setCodec().

### const QVariant &ShellCommand::cookie() const

See also setCookie().

### int ShellCommand::defaultTimeoutS() const

See also setDefaultTimeoutS().

### const QString &ShellCommand::defaultWorkingDirectory() const

### QString ShellCommand::displayName() const

See also setDisplayName().

### void ShellCommand::execute()

### `[signal]` void ShellCommand::finished(bool ok, int exitCode, const QVariant &cookie)

### unsigned ShellCommand::flags() const

### bool ShellCommand::hasProgressParser() const

### int ShellCommand::lastExecutionExitCode() const

### bool ShellCommand::lastExecutionSuccess() const

### `[virtual]` const QProcessEnvironment ShellCommand::processEnvironment() const

### `[virtual protected]` unsigned ShellCommand::processFlags() const

### `[virtual]` SynchronousProcessResponse ShellCommand::runCommand(const FileName &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter)

### void ShellCommand::setCodec(QTextCodec *codec)

See also codec().

### void ShellCommand::setCookie(const QVariant &cookie)

See also cookie().

### void ShellCommand::setDefaultTimeoutS(int timeout)

See also defaultTimeoutS().

### void ShellCommand::setDisplayName(const QString &name)

See also displayName().

### void ShellCommand::setOutputProxyFactory(const std::function<OutputProxy *() > &factory)

### void ShellCommand::setProgressParser(ProgressParser *parser)

See also hasProgressParser().

### void ShellCommand::setProgressiveOutput(bool progressive)

### `[signal]` void ShellCommand::stdErrText(const QString &)

### `[signal]` void ShellCommand::stdOutText(const QString &)

### `[signal]` void ShellCommand::success(const QVariant &cookie)

### `[signal]` void ShellCommand::terminate()

### `[protected]` int ShellCommand::timeoutS() const

### `[protected]` QString ShellCommand::workDirectory(const QString &wd) const