Results 1 to 20 of 20

Thread: Qt Creator plugin: how to insert foreign widgets from my plugin into QtQuick Designer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Creator plugin: how to insert foreign widgets from my plugin into QtQuick Desi

    I don't think Qt Quick Designer plugin is tailored to handle sub-plugins. You can easily verify that by seeing if the plugin tries to fetch a list of objects in its extensionsInitialized() method.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Apr 2014
    Posts
    125
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Qt Creator plugin: how to insert foreign widgets from my plugin into QtQuick Desi

    Hi
    Thank you very much for the reply. I'm not sure what you mean by "the plugin tries to fetch a list of objects....". What I have done is to try to list all the objects exposed by the QML Designer plugin in the QCreator pluigin manager. I have tried this code in a sample widget app, but it fails.

    Here my code:
    #include "C:\qt-creator-opensource-src-3.1.0\src\libs\extensionsystem\pluginmanager.h"

    ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance();
    QList<QObject*> objects = pm->allObjects();
    foreach(QObject* obj, objects)
    {
    QString objInfo = QString(QString::fromStdString("%1 (%2)"))
    .arg(obj->objectName())
    .arg(QString::fromStdString(obj->metaObject()->className()));
    qDebug() << objInfo;
    }

    I'm getting this crash at compile time:
    error: undefined reference to `_imp___ZN15ExtensionSystem13PluginManager8instanc eEv'
    error: undefined reference to `_imp___ZN15ExtensionSystem13PluginManager10allObj ectsEv'
    :-1: error: release/main.o: bad reloc address 0x20 in section `.text$_ZN7QStringD1Ev[__ZN7QStringD1Ev]'

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Creator plugin: how to insert foreign widgets from my plugin into QtQuick Desi

    Quote Originally Posted by mut View Post
    Hi
    Thank you very much for the reply. I'm not sure what you mean by "the plugin tries to fetch a list of objects....".
    I mean exactly what I wrote -- see if the plugin gets some list of objects in its extensionsInitialized() method. If you don't understand such a simple thing then I have no idea how you intend to write a plugin that extends Qt Quick Designer.

    After having a quick look at the current repository (https://qt.gitorious.org/qt-creator/...gnerplugin.cpp) one can see that extensionsInitialized() doesn't expect any objects in the object pool to be available and the only object it exposes itself is its settings pane. So I guess you are out of luck and you will have to modify the plugin's code directly.

    I'm getting this crash at compile time:
    error: undefined reference to `_imp___ZN15ExtensionSystem13PluginManager8instanc eEv'
    error: undefined reference to `_imp___ZN15ExtensionSystem13PluginManager10allObj ectsEv'
    :-1: error: release/main.o: bad reloc address 0x20 in section `.text$_ZN7QStringD1Ev[__ZN7QStringD1Ev]'
    It is not a crash, it is a linking error as you are probably not linking to some needed library (e.g. the core plugin of Qt Creator).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 14th February 2014, 08:36
  2. Replies: 2
    Last Post: 5th October 2012, 13:55
  3. Need your help with designer plugin built with Creator
    By high_flyer in forum Qt Programming
    Replies: 4
    Last Post: 27th November 2010, 14:46
  4. Replies: 3
    Last Post: 13th September 2010, 21:14
  5. Replies: 1
    Last Post: 22nd January 2007, 12:13

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.