RunControl Class | Extending Qt Creator Manual

Extending Qt Creator Manual | RunControl

Extending Qt Creator Manual 4.5.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

class | WorkerFactory

## Public Functions

| RunControl(RunConfiguration *runConfiguration, Core::Id mode)
| ~RunControl() override
Abi | abi() const
virtual void | appendMessage(const QString &msg, Utils::OutputFormat format)
Utils::ProcessHandle | applicationProcessHandle() const
bool | canReUseOutputPane(const RunControl *other) const
RunWorker * | createWorker(Core::Id id)
IDevice::ConstPtr | device() const
virtual QString | displayName() const
void | forceStop()
Utils::Icon | icon() const
void | initiateFinish()
void | initiateReStart()
void | initiateStart()
void | initiateStop()
bool | isRunning() const
bool | isStarting() const
bool | isStopped() const
bool | isStopping() const
Utils::OutputFormatter * | outputFormatter() const
Project * | project() const
bool | promptToStop(bool *optionalPrompt = nullptr) const
RunConfiguration * | runConfiguration() const
Core::Id | runMode() const
const Runnable & | runnable() const
void | setApplicationProcessHandle(const Utils::ProcessHandle &handle)
void | setDisplayName(const QString &displayName)
void | setIcon(const Utils::Icon &icon)
void | setPromptToStop(const std::function<bool( bool * ) > &promptToStop)
void | setRunnable(const Runnable &runnable)
bool | supportsReRunning() const

## Signals

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

## Static Public Members

WorkerCreator | producer(RunConfiguration *runConfiguration, Core::Id runMode)
void | registerWorker(Core::Id runMode, const WorkerCreator &producer, const Constraint &constraint = {})
void | registerWorker(Core::Id runMode, const Constraint &constraint, int priority = 0)
void | registerWorker(Core::Id runMode, int priority = 0)
void | registerWorkerCreator(Core::Id id, const WorkerCreator &workerCreator)
bool | showPromptToStopDialog(const QString &title, const QString &text, const QString &stopButtonText = QString(), const QString &cancelButtonText = QString(), bool *prompt = nullptr)

## Detailed Description

The RunControl class instances represent one item that is run.

## Member Function Documentation

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

Default constructs an instance of RunControl.

### RunControl::~RunControl()

Destroys the instance of RunControl.

### Abi RunControl::abi() const

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

### `[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.

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

### RunWorker *RunControl::createWorker(Core::Id id)

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

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

See also setDisplayName().

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

### void RunControl::forceStop()

### 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().

### void RunControl::initiateFinish()

### void RunControl::initiateReStart()

### void RunControl::initiateStart()

### void RunControl::initiateStop()

### bool RunControl::isRunning() const

### bool RunControl::isStarting() const

### bool RunControl::isStopped() const

### bool RunControl::isStopping() const

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

### `[static]` WorkerCreator RunControl::producer(RunConfiguration *runConfiguration, Core::Id runMode)

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

### 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.

See also setPromptToStop().

### `[static]` void RunControl::registerWorker(Core::Id runMode, const WorkerCreator &producer, const Constraint &constraint = {})

### `[static]` void RunControl::registerWorker(Core::Id runMode, const Constraint &constraint, int priority = 0)

### `[static]` void RunControl::registerWorker(Core::Id runMode, int priority = 0)

### `[static]` void RunControl::registerWorkerCreator(Core::Id id, const WorkerCreator &workerCreator)

### 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::setDisplayName(const QString &displayName)

See also displayName().

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

See also icon().

### void RunControl::setPromptToStop(const std::function<bool( bool * ) > &promptToStop)

See also promptToStop().

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

See also runnable().

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

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

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

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

### bool RunControl::supportsReRunning() const