How to create a Qt Creator plugin in C++, a working example explained

This article will show you all you need to know to create a Qt Creator plugin in C++.

Qt Creator is the official IDE of Qt and one of the most used by C++ developers. Creating a plugin for Qt Creator is the best way to extend its functionalities and it’s pretty easy to do as you’re going to learn here.

Before we start, you need to know that everything you will find here is based and tested on Qt 5.14 and Qt Creator 4.11, which are the latest versions at the time of writing. Things might change a bit in the future, but hopefully key concepts will stay the same.

Some theory

Before moving to something practical, it’s good to understand few concepts behind plugin design and implementation.

Plugin Structure

From a software design point of view, a Qt Creator plugin is extremely simple. In the simplest case, the only class you really need is one that implements the ExtensionSystem::IPlugin interface.

How to create a Qt Creator plugin in C++ - Qt Creator plugin UML diagram

More realistically, you probably need to handle user settings as well, hence you might also need to implement the following classes:

  • Something that stores your user settings during execution (like the class

    1 Comment

    1. walter

      good sharing, and i do it following your steps.
      But one problem found, can not see the item(OptPageMainWidget) on OptionsPage. Through debuging it can not go to QWidget * OptPageMain::widget(), do you have any comments about that.

      qt_creator_version:qt-creator-opensource-src-4.3.1
      compiler:mingw32
      qt_lib: QT_5.9.3

      Reply

    Leave a Comment

    Your email address will not be published. Required fields are marked *