In order to create a Qt Creator plugin we need to create two files: the project's file descriptor, ".pro"(This file is commonly used by all Qt projects), and the plugin specification file. The description file must contain all project files and the plugin's name, that must be specified in the Target variable. The specification file must be named as "PluginName.pluginspec", where PluginName is exactly the same as the value of the Target var in the description file.
The specification file is a XML file that has all necessary information to load the plugin and some description. This is an example of a specification file:
<plugin name="NAME" version="1.1.0" compatVersion="1.1.0">
<vendor>VENDOR</vendor>
<copyright>(C) 2009 COPYRIGHTED</copyright>
<license>LGPL</license>
<description>DESCRIPTION</description>
<url>URL</url>
<dependencyList>
<dependency name="Core" version="1.1.0"/>
</dependencyList>
</plugin>
After creating the initial files, we can start to implement the plugin. First of all, we need to create a class that extends IPlugin (present in the Extension System). To extend IPlugin we need to implement two methods: initialize and extensionsInitialized and add the command Q_EXPORT_PLUGIN(PluginName), where PluginName is the name defined in the target variable in the project description file. This class must initialize and register all main components of the plugin and deallocate and delete all the created objects.