Creating plugins for QT Creator

  • I'm trying to chase down information on this. The QT documentation is somewhat sparse, but as far as I can make out, if I make a plugin for QT Creator, if I want to distribute it, I have to separately rebuild it for every version of QT Creator, built with every possible compiler that the user's QT Creator might have been built with. Is that right? I think that's what this page is talking about:

    Some documentation seems to say that if I want to build a QT Creator plugin, I have to rebuild the entire QT Creator. That can't be right; end users just install a QT Creator plugin and away they go - they don't need to go recompiling anything, surely?

    To quell my confusion, I found a QTCreator plugin on sourceforge and had a look at it; it's a single *.so file, and an xml file containing this:

    bq. <plugin name="QtcCppcheck" version="3.2.1" compatVersion="3.2.1">
    <category>Code Analyzer</category>
    <copyright>(C) Gres</copyright>
    <license>MIT license</license>
    <description>Integrates Cppcheck tool into Qt Creator</description>
    <dependency name="Core" version="3.2.1"/>
    <dependency name="ProjectExplorer" version="3.2.1"/>

    So if I'm reading this correctly, it needs a "Core" compatible with V3.2.1, and a "ProjectExplorer" also compatible with V3.2.1

    3.2.1 of what? Core certainly sounds familiar, but ProjectExplorer?

    The goal is to end up with some kind of self-contained set of plugin files that the user can be given and, after installing, the new functionality appears in their QTCreator. having to build a separate one for every possible version of QTCreator built with every possible set of QT Libraries and every possible compiler/linker seems so ridiculous that I must be misunderstanding things.

  • "Core" and "ProjectExplorer" refer to Qt Creator plugins, version 3.2.1 in this case.

  • Hi, when you want to compile your plugin, you need (in you .pro file) to point out where the sources and binaries for the target QtCreator are. This is needed for a successful compilation of your plugin.
    (And that's why you need first to compile QtCreator itself. I.e. you don't really need the app, just some other files). Also building in debug mode is not recommended, both QtCreator and your plugin should be compiled in Release mode.

    Once you have the .dll for you plugin, you can copy it to any Qt installation (along with the .pluginspec file). When QtCreator starts and loads the plugins, it checks that the plugins are built against the same version, right now it's 3.2.1. This is to make sure the shared data structures are intact across DLL boundaries etc.

    Last year I built a plugin for "Wordstar emulation": it works fine on Windows, Mac and Linux, but I have to recompile it (and QtCreator) when there's a new Qt release :-(

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.