Important: Please read the Qt Code of Conduct -

Qt creator plugin crash

  • Hi ! I have try to build simplest qt creator plugin using standart Libraries->Qt creator plugin selection from project wizard. Of course, previosly I build debug version of qt creator from sources, using qmake with flags -r -spec macx-g++ CONFIG+=debug CONFIG+=x86_64 CONFIG+=declarative_debug CONFIG+=qml_debug, which qt creator uses for debuging (plugin also was built with the same flags). Plugin was successfully compiled and installed to my qt creator debuging assembly. But when I try to run it, qt creator (my debugging assembly of course) crashes, although it worked well without my plugin. Crash occours BEFORE(!!!) call of
    in function
    AnalyzerManagerPrivate::modeChanged() (from qt creator code itself)
    here is it code:
    void AnalyzerManagerPrivate::modeChanged(IMode *mode)
    if (mode && mode == m_mode) {
    static bool firstTime = true;
    if (firstTime)
    firstTime = false;
    } else {
    in the first call of this function. The reason of crash: m_mainWindow = NULL.
    When I add if(!m_mainWindow) return; into beginning of function, it begins works.
    But function initialize() of my plugin not called at all. All other plugins loads correctly and qt creator works.
    Can anybody say, wath is wrong ?

    P.S. My working enironment is: MacOS 10.8.2, QtSDK 5.0.0, Qt Creator 2.6.1. Qt Creator sources also 2.6.1


  • Addition.
    I have see, how plugins initilizes. The initialization code is :
    bool PluginSpecPrivate::initializePlugin()
    if (!plugin->initialize(arguments, &err)) {
    errorString = QCoreApplication::translate("PluginSpec", "Plugin initialization failed: %1").arg(err);
    hasError = true;
    return false;
    plugin->initialize(arguments, &err) is namelly call of plugin initialize() function. For all plugins except my, calls correct initialize(). For my plugin calls initialize() function of CorePlugin ! My initialize() function not calls ! Can anybody say, what wrong I to do ???

  • Moderators

    Is your plugin in its own namespace?

  • No. Is it important ??? Just try !!! :)

  • Sorry, I mistakes when say no. Yes. It uses own namespace. Plugin code was generated by wizard and I not change any string. I thing now that in has some incorrect shared library model. But cannot understand exactly. If cannot solve problem untill tomorrov, I'll use IDA.

  • Moderators

    Sorry, no idea then. Are you sure that you are using exactly the same compiler and Qt that was used to build Creator with? It is somewhat picky...

    Does it load your plugin at all? On linux you can check with strace, no idea which tool does something similar on the mac though.

  • Yes. Compiler was exactly the same. Moreover, now I reassemble debugging qt creator using qt creartor, instead command line. Result not changes. At first occours call of
    with m_mainWindow=NULL,
    at second MyPlugin::initilize() not calls.
    Now I'm downloading QT SDK 5.0.0 for my virtual Linux and WindowsXP mashines and try will try them. Maybe it is only MacOS problem. Although more probably, that it is a problem of qt creator wizard, which creates plugin projetcs with some wrong options. Indeed, qt creator with it's own .pro builds and works absolutelly well.

  • Moderators

    I have to admit that I never used the Qt Creator plugin wizard:) I just add my code into the Qt Creator build system and am done with it.

  • Result of building and test under Linux (32-bit Ubuntu running on VMWare)

    /home/eugenk/Projects/QT/build/qtcreator/debug/lib/qtcreator/plugins/MyCompany/ Plugin verification data mismatch in '/home/eugenk/Projects/QT/build/qtcreator/debug/lib/qtcreator/plugins/MyCompany/'

    Plugin was not loaded at all ! So it is clear, that wizard template for plugin is incorrect and cannot be uzed.

    Sorry, can you tell, how to add my code into qt creator build system in version 2.6.1 ?

  • Moderators

    Did you "file a bug report": about this? We should fix that wizard:-)

    The error message you are seeing is actually triggered by Qt 5, due to the json information being missing. So this is a Qt 5 issue and the code does work fine with a Qt 4-based Qt Creator. We will need to update the build system to generate and include that json file.

  • Not, I not write yet, but will to do.

    By the way, if you are a member of qt creator team, can you give me an advice, where can I read about qt creator internals and plugins development ? I know Writing-Qt-Cretor-plugins.pdf, but this document is rather old. Do you know some regular developer's documentation ?

    I want to write plugin for D laguage ( support. It seems me more reasonable idea, that MonoD (MonoDevelop) or DDT (Eclipse), because very fast D compiler DMD comes with c-sources, and for C++-based IDE I'll get ready D-parser at once. So D-editor will be not very work-expencive part. And maybe debuger also will be not very hard...

  • Moderators is the best we have. We do change a lot of things all the time (there are no binary guarantees whatsoever for Qt Creator!), so documentation does get outdated fast.

    I am not sure we would accept a D plugin: Each plugin has some maintenance overhead (even 3rd party ones) as we need to keep them at the very least in a state where they can be built, reviews need to be done, etc.

    D has no connection whatsoever to Qt development as far as I know, so I am not sure it is a good fit for a Qt-centric IDE. Having said that: You are of course free to have the plugin outside Creator. It is not the first such plugin.

Log in to reply