ProjectExplorer: Update parts of RunConfigurationFactory docs

Change-Id: I4b9addde8055cb07565eea1c62e4e5b47725ff48
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-06-12 07:05:08 +02:00
parent 4b1adeca7f
commit beee73ce5b

View File

@@ -145,12 +145,15 @@ void GlobalOrProjectAspect::resetProjectToGlobalSettings()
/*! /*!
\class ProjectExplorer::RunConfiguration \class ProjectExplorer::RunConfiguration
\inmodule QtCreator
\inheaderfile projectexplorer/runconfiguration.h
\brief The RunConfiguration class is the base class for a run configuration. \brief The RunConfiguration class is the base class for a run configuration.
A run configuration specifies how a target should be run, while a runner A run configuration specifies how a target should be run, while a runner
does the actual running. does the actual running.
The target owns the RunConfiguraitons and a RunControl will need to copy all The target owns the RunConfigurations and a RunControl will need to copy all
necessary data as the RunControl may continue to exist after the RunConfiguration necessary data as the RunControl may continue to exist after the RunConfiguration
has been destroyed. has been destroyed.
@@ -382,43 +385,46 @@ Runnable RunConfiguration::runnable() const
} }
/*! /*!
\class ProjectExplorer::IRunConfigurationFactory \class ProjectExplorer::RunConfigurationFactory
\inmodule QtCreator
\inheaderfile projectexplorer/runconfiguration.h
\brief The IRunConfigurationFactory class restores run configurations from \brief The RunConfigurationFactory class is used to create and persist
settings. run configurations.
The run configuration factory is used for restoring run configurations from The run configuration factory is used for restoring run configurations from
settings and for creating new run configurations in the \gui {Run Settings} settings and for creating new run configurations in the \gui {Run Settings}
dialog. dialog.
To restore run configurations, use the
\c {bool canRestore(Target *parent, const QString &id)}
and \c {RunConfiguration* create(Target *parent, const QString &id)}
functions.
To generate a list of creatable run configurations, use the A RunConfigurationFactory instance is responsible for handling one type of
\c {QStringList availableCreationIds(Target *parent)} and run configurations. This can be restricted to certain project and device
\c {QString displayNameForType(const QString&)} functions. To create a types.
run configuration, use \c create().
*/
/*! RunConfigurationFactory instances register themselves into a global list on
\fn QStringList ProjectExplorer::IRunConfigurationFactory::availableCreationIds(Target *parent) const construction and deregister on destruction. It is recommended to make them
a plain data member of a structure that is allocated in your plugin's
Shows the list of possible additions to a target. Returns a list of types. ExtensionSystem::IPlugin::initialize() method.
*/
/*!
\fn QString ProjectExplorer::IRunConfigurationFactory::displayNameForId(Core::Id id) const
Translates the types to names to display to the user.
*/ */
static QList<RunConfigurationFactory *> g_runConfigurationFactories; static QList<RunConfigurationFactory *> g_runConfigurationFactories;
/*!
Constructs a RunConfigurationFactory instance and registers it into a global
list.
Derived classes should set suitably properties to specify the type of
run configurations they can handle.
*/
RunConfigurationFactory::RunConfigurationFactory() RunConfigurationFactory::RunConfigurationFactory()
{ {
g_runConfigurationFactories.append(this); g_runConfigurationFactories.append(this);
} }
/*!
De-registers the instance from the global list of factories and destructs it.
*/
RunConfigurationFactory::~RunConfigurationFactory() RunConfigurationFactory::~RunConfigurationFactory()
{ {
g_runConfigurationFactories.removeOne(this); g_runConfigurationFactories.removeOne(this);
@@ -472,11 +478,15 @@ RunConfigurationFactory::availableCreators(Target *target) const
} }
/*! /*!
Adds a list of device types for which this RunConfigurationFactory Adds a device type for which this RunConfigurationFactory
can create RunConfigurations. can create RunConfigurations.
If this function is never called for a RunConfiguarionFactory, If this function is never called for a RunConfigurationFactory,
the factory will create RunConfigurations for all device types. the factory will create RunConfiguration objects for all device types.
This function should be used in the constructor of derived classes.
\sa addSupportedProjectType()
*/ */
void RunConfigurationFactory::addSupportedTargetDeviceType(Core::Id id) void RunConfigurationFactory::addSupportedTargetDeviceType(Core::Id id)
@@ -489,6 +499,18 @@ void RunConfigurationFactory::setDecorateDisplayNames(bool on)
m_decorateDisplayNames = on; m_decorateDisplayNames = on;
} }
/*!
Adds a project type for which this RunConfigurationFactory
can create RunConfigurations.
If this function is never called for a RunConfigurationFactory,
the factory will create RunConfigurations for all project types.
This function should be used in the constructor of derived classes.
\sa addSupportedTargetDeviceType()
*/
void RunConfigurationFactory::addSupportedProjectType(Core::Id id) void RunConfigurationFactory::addSupportedProjectType(Core::Id id)
{ {
m_supportedProjectTypes.append(id); m_supportedProjectTypes.append(id);