Creating Extensions and Plugins
At its very core, Qt Creator consists of a plugin loader that loads and runs a set of C++-based plugins and Lua-based extensions, which then actually provide the functionality that you know from Qt Creator the IDE. So, even the main application window and menus are all provided by plugins. Plugins can use different means to provide other plugins access to their functionality and to allow them to extend certain aspects of the application.
For example the Core plugin, which is the very basic plugin that must be present for Qt Creator to run at all, provides the main window itself, and API for adding menu items, modes, editor types, navigation panels and many other things.
The TextEditor plugin provides a framework and base implementation for different text editors with highlighting, completion and folding, that is then used by other plugins to add more specialized text editor types to Qt Creator, like for editing C/C++ or .pro files.
You can extend Qt Creator by writing:
- Lua-based extensions
- C++-based plugins
Lua-Based Extensions
A Lua extension consists of a Lua script that specifies the extension and loads it. Therefore, you don't need to compile extensions for different platforms. Also, we aim to keep the exported Lua API more stable than the exported C++ API.
However, the API doesn't support everything you can do with C++. Also, Lua is an interpreted language, which might negatively impact performance.
For a list of supported Lua modules, see Qt Creator Lua API.
To create Lua-based extensions, see:
- Getting Qt and Qt Creator
- Creating Lua-Based Extensions
- Plugin Meta Data
- The Action Manager and Commands
- Distributing Extensions and Plugins
C++-Based Plugins
A C++-based plugin provides you with access to all the exported Qt Creator C++ API.
However, you have to build and distribute the plugin for all the supported platforms. Also, the backwards compatibility of the API is limited, so you have to regularly adapt the plugin when the API it uses is changed.
For a summary of API changes in selected libraries and plugins, see the API change log.
After reading the following topics, you will understand the contents of a basic C++-based plugin, how to write a specification file for it, what its lifecycle is, and what the general principles are for extending its functionality and providing interfaces for other extensions and plugins. You can then write your first plugin.
Copyright © The Qt Company Ltd. and other contributors. 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.
