PluginSpec Class

class ExtensionSystem::PluginSpec

The PluginSpec class contains the information of the plugin's embedded meta data and information about the plugin's current state. More...

Header: #include <extensionsystem/pluginspec.h>

Public Types

enum State { Invalid, Read, Resolved, Loaded, Initialized, …, Deleted }

Public Functions

virtual void addArgument(const QString &argument)
virtual ExtensionSystem::PluginSpec::PluginArgumentDescriptions argumentDescriptions() const
virtual QStringList arguments() const
virtual QString category() const
virtual QString compatVersion() const
virtual QString copyright() const
virtual QVector<ExtensionSystem::PluginDependency> dependencies() const
virtual QHash<ExtensionSystem::PluginDependency, ExtensionSystem::PluginSpec *> dependencySpecs() const
virtual QString description() const
virtual QString errorString() const
virtual Utils::FilePath filePath() const
virtual bool hasError() const
virtual bool isAvailableForHostPlatform() const
virtual bool isDeprecated() const
virtual bool isEffectivelyEnabled() const
virtual bool isEnabledByDefault() const
virtual bool isEnabledBySettings() const
virtual bool isEnabledIndirectly() const
virtual bool isExperimental() const
virtual bool isForceDisabled() const
virtual bool isForceEnabled() const
virtual bool isRequired() const
virtual bool isSoftLoadable() const
virtual QString license() const
virtual Utils::FilePath location() const
virtual QString longDescription() const
virtual QJsonObject metaData() const
virtual QString name() const
(since 3.0) virtual QRegularExpression platformSpecification() const
virtual bool provides(ExtensionSystem::PluginSpec *spec, const ExtensionSystem::PluginDependency &dependency) const
virtual bool requiresAny(const QSet<ExtensionSystem::PluginSpec *> &plugins) const
virtual void setArguments(const QStringList &arguments)
virtual void setEnabledBySettings(bool value)
virtual ExtensionSystem::PluginSpec::State state() const
virtual QString url() const
virtual QString vendor() const
virtual QString version() const

Detailed Description

The plugin spec is also filled with more information as the plugin goes through its loading process (see PluginSpec::State). If an error occurs, the plugin spec is the place to look for the error details.

Member Type Documentation

enum PluginSpec::State

The State enum indicates the states the plugin goes through while it is being loaded.

The state gives a hint on what went wrong in case of an error.

ConstantValueDescription
ExtensionSystem::PluginSpec::Invalid0Starting point: Even the plugin meta data was not read.
ExtensionSystem::PluginSpec::Read1The plugin meta data has been successfully read, and its information is available via the PluginSpec.
ExtensionSystem::PluginSpec::Resolved2The dependencies given in the description file have been successfully found, and are available via the dependencySpecs() function.
ExtensionSystem::PluginSpec::Loaded3The plugin's library is loaded and the plugin instance created (available through plugin()).
ExtensionSystem::PluginSpec::Initialized4The plugin instance's IPlugin::initialize() function has been called and returned a success value.
ExtensionSystem::PluginSpec::Running5The plugin's dependencies are successfully initialized and extensionsInitialized has been called. The loading process is complete.
ExtensionSystem::PluginSpec::Stopped6The plugin has been shut down, i.e. the plugin's IPlugin::aboutToShutdown() function has been called.
ExtensionSystem::PluginSpec::Deleted7The plugin instance has been deleted.

Member Function Documentation

[virtual] void PluginSpec::addArgument(const QString &argument)

Adds argument to the command line arguments specific to the plugin.

[virtual] ExtensionSystem::PluginSpec::PluginArgumentDescriptions PluginSpec::argumentDescriptions() const

Returns a list of descriptions of command line arguments the plugin processes.

[virtual] QStringList PluginSpec::arguments() const

Returns command line arguments specific to the plugin. Set at startup.

See also setArguments().

[virtual] QString PluginSpec::category() const

Returns the category that the plugin belongs to. Categories are used to group plugins together in the UI. Returns an empty string if the plugin does not belong to a category.

[virtual] QString PluginSpec::compatVersion() const

Returns the plugin compatibility version. This is valid after the PluginSpec::Read state is reached.

Returns the plugin copyright. This is valid after the PluginSpec::Read state is reached.

[virtual] QVector<ExtensionSystem::PluginDependency> PluginSpec::dependencies() const

The plugin dependencies. This is valid after the PluginSpec::Read state is reached.

[virtual] QHash<ExtensionSystem::PluginDependency, ExtensionSystem::PluginSpec *> PluginSpec::dependencySpecs() const

Returns the list of dependencies, already resolved to existing plugin specs. Valid if PluginSpec::Resolved state is reached.

See also PluginSpec::dependencies().

[virtual] QString PluginSpec::description() const

Returns the plugin description. This is valid after the PluginSpec::Read state is reached.

[virtual] QString PluginSpec::errorString() const

Returns a detailed, possibly multi-line, error description in case of an error.

[virtual] Utils::FilePath PluginSpec::filePath() const

Returns the absolute path to the plugin.

[virtual] bool PluginSpec::hasError() const

Returns whether an error occurred while reading or starting the plugin.

[virtual] bool PluginSpec::isAvailableForHostPlatform() const

Returns whether the plugin works on the host platform.

[virtual] bool PluginSpec::isDeprecated() const

Returns whether the plugin has its deprecated flag set.

[virtual] bool PluginSpec::isEffectivelyEnabled() const

Returns whether the plugin is loaded at startup.

See also isEnabledBySettings().

[virtual] bool PluginSpec::isEnabledByDefault() const

Returns whether the plugin is enabled by default. A plugin might be disabled because the plugin is experimental or deprecated, or because the installation settings define it as disabled by default.

[virtual] bool PluginSpec::isEnabledBySettings() const

Returns whether the plugin should be loaded at startup, taking into account the default enabled state, and the user's settings.

Note: This function might return false even if the plugin is loaded as a requirement of another enabled plugin.

See also isEffectivelyEnabled().

[virtual] bool PluginSpec::isEnabledIndirectly() const

Returns true if loading was not done due to user unselecting this plugin or its dependencies.

[virtual] bool PluginSpec::isExperimental() const

Returns whether the plugin has its experimental flag set.

[virtual] bool PluginSpec::isForceDisabled() const

Returns whether the plugin is disabled via the -noload option on the command line.

[virtual] bool PluginSpec::isForceEnabled() const

Returns whether the plugin is enabled via the -load option on the command line.

[virtual] bool PluginSpec::isRequired() const

Returns whether the plugin is required.

[virtual] bool PluginSpec::isSoftLoadable() const

Returns whether the plugin is allowed to be loaded during runtime without a restart.

[virtual] QString PluginSpec::license() const

Returns the plugin license. This is valid after the PluginSpec::Read state is reached.

[virtual] Utils::FilePath PluginSpec::location() const

Returns the absolute path to the directory containing the plugin.

[virtual] QString PluginSpec::longDescription() const

Returns the plugin's long description. This is valid after the PluginSpec::Read state is reached.

[virtual] QJsonObject PluginSpec::metaData() const

Returns the plugin meta data.

[virtual] QString PluginSpec::name() const

Returns the plugin name. This is valid after the PluginSpec::Read state is reached.

[virtual, since 3.0] QRegularExpression PluginSpec::platformSpecification() const

Returns a QRegularExpression matching the platforms this plugin works on. An empty pattern implies all platforms.

This function was introduced in Qt 3.0.

[virtual] bool PluginSpec::provides(ExtensionSystem::PluginSpec *spec, const ExtensionSystem::PluginDependency &dependency) const

Returns whether the plugin spec can be used to fill the dependency of this plugin.

See also PluginSpec::dependencies().

[virtual] bool PluginSpec::requiresAny(const QSet<ExtensionSystem::PluginSpec *> &plugins) const

Returns whether the plugin requires any of the plugins specified by plugins.

[virtual] void PluginSpec::setArguments(const QStringList &arguments)

Sets the command line arguments specific to the plugin to arguments.

See also arguments().

[virtual] void PluginSpec::setEnabledBySettings(bool value)

Sets whether the plugin should be loaded at startup to value.

See also isEnabledBySettings().

[virtual] ExtensionSystem::PluginSpec::State PluginSpec::state() const

Returns the state in which the plugin currently is. See the description of the PluginSpec::State enum for details.

[virtual] QString PluginSpec::url() const

Returns the plugin URL where you can find more information about the plugin. This is valid after the PluginSpec::Read state is reached.

[virtual] QString PluginSpec::vendor() const

Returns the plugin vendor. This is valid after the PluginSpec::Read state is reached.

[virtual] QString PluginSpec::version() const

Returns the plugin version. This is valid after the PluginSpec::Read state is reached.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.