IPlugin Class

(ExtensionSystem::IPlugin)

The IPlugin class is an abstract base class that must be implemented once for each plugin. More...

Header: #include <IPlugin>

Public Types

enum ShutdownFlag { SynchronousShutdown, AsynchronousShutdown }

Public Functions

virtual ExtensionSystem::IPlugin::ShutdownFlag aboutToShutdown()
virtual QVector<QObject *> createTestObjects() const
virtual bool delayedInitialize()
virtual void extensionsInitialized()
virtual bool initialize(const QStringList &arguments, QString *errorString) = 0
ExtensionSystem::PluginSpec *pluginSpec() const
virtual QObject *remoteCommand(const QStringList &, const QString &, const QStringList &)

Signals

Detailed Description

The IPlugin class is an abstract base class that must be implemented once for each plugin.

A plugin needs to provide meta data in addition to the actual plugin library, so the plugin manager can find the plugin, resolve its dependencies, and load it. For more information, see Plugin Meta Data.

Plugins must provide one implementation of the IPlugin class, located in a library that matches the name attribute given in their meta data. The IPlugin implementation must be exported and made known to Qt's plugin system, using the Q_PLUGIN_METADATA macro with an IID set to "org.qt-project.Qt.QtCreatorPlugin".

For more information, see Plugin Life Cycle.

Member Type Documentation

enum IPlugin::ShutdownFlag

This enum type holds whether the plugin is shut down synchronously or asynchronously.

ConstantValueDescription
ExtensionSystem::IPlugin::SynchronousShutdown0The plugin is shut down synchronously.
ExtensionSystem::IPlugin::AsynchronousShutdown1The plugin needs to perform asynchronous actions before it shuts down.

Member Function Documentation

[virtual] ExtensionSystem::IPlugin::ShutdownFlag IPlugin::aboutToShutdown()

[signal] void IPlugin::asynchronousShutdownFinished()

[virtual] QVector<QObject *> IPlugin::createTestObjects() const

Returns objects that are meant to be passed on to QTest::qExec().

This function will be called if the user starts Qt Creator with -test PluginName or -test all.

The ownership of returned objects is transferred to caller.

[virtual] bool IPlugin::delayedInitialize()

[virtual] void IPlugin::extensionsInitialized()

[pure virtual] bool IPlugin::initialize(const QStringList &arguments, QString *errorString)

ExtensionSystem::PluginSpec *IPlugin::pluginSpec() const

Returns the PluginSpec corresponding to this plugin. This is not available in the constructor.

[virtual] QObject *IPlugin::remoteCommand(const QStringList &, const QString &, const QStringList &)