Extending Qt Creator Manual | RunControl

Extending Qt Creator Manual 4.3.0

# RunControl Class

(ProjectExplorer::RunControl)

The RunControl class instances represent one item that is run. More...

Header: | #include <RunControl>

- List of all members, including inherited members

## Public Types

enum | StopResult { StoppedSynchronously, AsynchronousStop }

## Public Functions

| RunControl(RunConfiguration *runConfiguration, Core::Id mode)
Abi | abi() const
virtual void | appendMessage(const QString &msg, Utils::OutputFormat format)
Utils::ProcessHandle | applicationProcessHandle() const
virtual void | bringApplicationToForeground()
bool | canReUseOutputPane(const RunControl *other) const
const Connection & | connection() const
IDevice::ConstPtr | device() const
virtual QString | displayName() const
Utils::Icon | icon() const
bool | isRunning() const
Utils::OutputFormatter * | outputFormatter() const
Project * | project() const
virtual bool | promptToStop(bool *optionalPrompt = nullptr) const
RunConfiguration * | runConfiguration() const
Core::Id | runMode() const
const Runnable & | runnable() const
void | setApplicationProcessHandle(const Utils::ProcessHandle &handle)
void | setConnection(const Connection &connection)
void | setDisplayName(const QString &displayName)
void | setIcon(const Utils::Icon &icon)
void | setRunnable(const Runnable &runnable)
virtual void | start() = 0
virtual StopResult | stop() = 0
virtual bool | supportsReRunning() const

## Signals

void | appendMessageRequested(ProjectExplorer::RunControl *runControl, const QString &msg, Utils::OutputFormat format)
void | applicationProcessHandleChanged()
void | finished()
void | started()

## Protected Functions

void | reportApplicationStart()
void | reportApplicationStop()
bool | showPromptToStopDialog(const QString &title, const QString &text, const QString &stopButtonText = QString(), const QString &cancelButtonText = QString(), bool *prompt = nullptr) const

## Detailed Description

The RunControl class instances represent one item that is run.

## Member Type Documentation

### enum RunControl::StopResult

## Member Function Documentation

### RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode)

Default constructs an instance of RunControl.

### Abi RunControl::abi() const

### `[virtual]` void RunControl::appendMessage(const QString &msg, Utils::OutputFormat format)

### `[signal]` void RunControl::appendMessageRequested(ProjectExplorer::RunControl *runControl, const QString &msg, Utils::OutputFormat format)

### Utils::ProcessHandle RunControl::applicationProcessHandle() const

A handle to the application process.

This is typically a process id, but should be treated as opaque handle to the process controled by this `RunControl`.

See also setApplicationProcessHandle().

### `[signal]` void RunControl::applicationProcessHandleChanged()

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

### `[virtual]` void RunControl::bringApplicationToForeground()

Brings the application determined by this RunControl's `applicationProcessHandle` to the foreground.

The default implementation raises the application on Mac, and does nothing elsewhere.

### bool RunControl::canReUseOutputPane(const RunControl *other) const

### const Connection &RunControl::connection() const

See also setConnection().

### IDevice::ConstPtr RunControl::device() const

### `[virtual]` QString RunControl::displayName() const

See also setDisplayName().

### `[signal]` void RunControl::finished()

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

### Utils::Icon RunControl::icon() const

Returns the icon to be shown in the Outputwindow.

TODO the icon differs currently only per "mode", so this is more flexible than it needs to be.

See also setIcon().

### bool RunControl::isRunning() const

### Utils::OutputFormatter *RunControl::outputFormatter() const

### Project *RunControl::project() const

### `[virtual]` bool RunControl::promptToStop(bool *optionalPrompt = nullptr) const

Prompts to stop. If optionalPrompt is passed, a Do not ask again checkbox is displayed and the result is returned in *optionalPrompt.

### `[protected]` void RunControl::reportApplicationStart()

### `[protected]` void RunControl::reportApplicationStop()

### RunConfiguration *RunControl::runConfiguration() const

### Core::Id RunControl::runMode() const

### const Runnable &RunControl::runnable() const

See also setRunnable().

### void RunControl::setApplicationProcessHandle(const Utils::ProcessHandle &handle)

See also applicationProcessHandle().

### void RunControl::setConnection(const Connection &connection)

See also connection().

### void RunControl::setDisplayName(const QString &displayName)

See also displayName().

### void RunControl::setIcon(const Utils::Icon &icon)

See also icon().

### void RunControl::setRunnable(const Runnable &runnable)

See also runnable().

### `[protected]` bool RunControl::showPromptToStopDialog(const QString &title, const QString &text, const QString &stopButtonText = QString(), const QString &cancelButtonText = QString(), bool *prompt = nullptr) const

Prompts to terminate the application with the Do not ask again checkbox.

### `[pure virtual]` void RunControl::start()

### `[signal]` void RunControl::started()

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

### `[pure virtual]` StopResult RunControl::stop()

### `[virtual]` bool RunControl::supportsReRunning() const