Extending Qt Creator Manual | IRunConfigurationFactory

Extending Qt Creator Manual 4.6.2

# IRunConfigurationFactory Class

(ProjectExplorer::IRunConfigurationFactory)

The IRunConfigurationFactory class restores run configurations from settings. More...

Header: | #include <IRunConfigurationFactory>

- List of all members, including inherited members

## Public Types

enum | CreationMode { UserCreate, AutoCreate }

## Public Functions

| IRunConfigurationFactory(QObject *parent = nullptr)
| ~IRunConfigurationFactory()
QList<RunConfigurationCreationInfo> | availableCreators(Target *parent, CreationMode mode = UserCreate) const
bool | canClone(Target *parent, RunConfiguration *product) const
virtual bool | canHandle(Target *target) const
bool | canRestore(Target *parent, const QVariantMap &map) const
RunConfiguration * | clone(Target *parent, RunConfiguration *product) const
RunConfiguration * | create(Target *parent, Core::Id id, const QString &extra) const
RunConfiguration * | restore(Target *parent, const QVariantMap &map) const

## Static Public Members

const QList<IRunConfigurationFactory *> | allRunConfigurationFactories()
IRunConfigurationFactory * | find(Target *parent, const QVariantMap &map)
IRunConfigurationFactory * | find(Target *parent, RunConfiguration *rc)
QList<IRunConfigurationFactory *> | find(Target *parent)

## Protected Functions

void | addFixedBuildTarget(const QString &displayName)
void | addSupportedProjectType(Core::Id id)
virtual QList<BuildTargetInfo> | availableBuildTargets(Target *parent, CreationMode mode = UserCreate) const
virtual bool | canCreateHelper(Target *parent, const QString &buildTarget) const
void | registerRunConfiguration(Core::Id runConfigBaseId)
void | setSupportedTargetDeviceTypes(const QList<Core::Id> &ids)

## Detailed Description

The IRunConfigurationFactory class restores run configurations from settings.

The run configuration factory is used for restoring run configurations from settings and for creating new run configurations in the Run Settings dialog. To restore run configurations, use the `bool canRestore(Target *parent, const QString &id)` and `RunConfiguration* create(Target *parent, const QString &id)` functions.

To generate a list of creatable run configurations, use the `QStringList availableCreationIds(Target *parent)` and `QString displayNameForType(const QString&)` functions. To create a run configuration, use `create()`.

## Member Type Documentation

### enum IRunConfigurationFactory::CreationMode

## Member Function Documentation

### IRunConfigurationFactory::IRunConfigurationFactory(QObject *parent = nullptr)

Default constructs an instance of IRunConfigurationFactory.

### IRunConfigurationFactory::~IRunConfigurationFactory()

Destroys the instance of IRunConfigurationFactory.

### `[protected]` void IRunConfigurationFactory::addFixedBuildTarget(const QString &displayName)

### `[protected]` void IRunConfigurationFactory::addSupportedProjectType(Core::Id id)

### `[static]` const QList<IRunConfigurationFactory *> IRunConfigurationFactory::allRunConfigurationFactories()

### `[virtual protected]` QList<BuildTargetInfo> IRunConfigurationFactory::availableBuildTargets(Target *parent, CreationMode mode = UserCreate) const

### QList<RunConfigurationCreationInfo> IRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode = UserCreate) const

### bool IRunConfigurationFactory::canClone(Target *parent, RunConfiguration *product) const

### `[virtual protected]` bool IRunConfigurationFactory::canCreateHelper(Target *parent, const QString &buildTarget) const

### `[virtual]` bool IRunConfigurationFactory::canHandle(Target *target) const

### bool IRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const

### RunConfiguration *IRunConfigurationFactory::clone(Target *parent, RunConfiguration *product) const

### RunConfiguration *IRunConfigurationFactory::create(Target *parent, Core::Id id, const QString &extra) const

### `[static]` IRunConfigurationFactory *IRunConfigurationFactory::find(Target *parent, const QVariantMap &map)

### `[static]` IRunConfigurationFactory *IRunConfigurationFactory::find(Target *parent, RunConfiguration *rc)

### `[static]` QList<IRunConfigurationFactory *> IRunConfigurationFactory::find(Target *parent)

### `[protected]` void IRunConfigurationFactory::registerRunConfiguration(Core::Id runConfigBaseId)

### RunConfiguration *IRunConfigurationFactory::restore(Target *parent, const QVariantMap &map) const

### `[protected]` void IRunConfigurationFactory::setSupportedTargetDeviceTypes(const QList<Core::Id> &ids)

Specifies a list of device types for which this RunConfigurationFactory can create RunConfiguration.

Not calling this function or using an empty list means no restriction.