Results 1 to 20 of 20

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

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

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

    Hello;

    I'm building a plugin for Qt Quick Designer.

    I was able to successfully create the basic Qt Creator plugin (http://doc.qt.digia.com/qtcreator-ex...st-plugin.html). Now I want to embed foreign widgets (W1, W2, W3, W4) from my plugin into QtQuick Designer itself. Obviously, I need to dig into QtQuick designer source code.

    These foreign widgets are W1, W2, W3, W4, please see the attached file for their intended location.
    W1: same nature as “Welcome”, “Design”, “Debug”, “Projects”, “Analyze”, “Help”. They will have the same parent.
    W2: ToolBox Widget. It will be a selectable item in the “Library” dropdown list
    W3: QGraphicsView. It will be a selectable item in the “main.qml” dropdown list
    W4: QTabWidget: It will be a selectable item in the “Open Documents” dropdown list

    My questions:
    1) I have the entire source code of Qt Creator but I’m unable to locate the code for W1?
    2) Where is the source code of the above refered dropdown lists? how these dropdown lists will interface with my code?
    3) How to ensure that W2,W3, W4 occupy the same area as their parent and are resizable with them?
    4) How do Qt Quick Designer code will call/interface with my code?

    Thank you for your help.

    Mut
    Last edited by mut; 23rd May 2014 at 18:37.

  2. #2
    Join Date
    May 2014
    Posts
    9
    Thanks
    1

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

    What do you mean by "foreign widgets"? Surely you don't mean widgets containing foreign language text?
    You should be able to do that without any trouble. Just type the foreign language text in the appropriate
    place. Many widgets such as buttons allow you to double-click on them and enter the text in WYSIWYG mode.
    Or do you mean something else?
    Tom

  3. #3
    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 Tom
    Thank you for the reply.
    The word "foreign" should not be here. What I m asking is how to incorporate Qt creator classes in my qt Creator plug in? how to interface the two ( q creator and my qt creator plug in)?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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

    Do you want to extend Qt Quick Designer or substitute it with your own?
    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.


  5. #5
    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

    Yes, I'm writing a Qt Quick designer plugin. Within my code: I need to add my items into these Qt Quick designer objects:

    - Object1: “Welcome”, “Design”, “Debug”, “Projects”, “Analyze”, “Help” vertical tab bar.
    - Object2: “Library” dropdown list
    - Object3: “main.qml” dropdown list
    - Object4: “Open Documents” dropdown list

    Thanks

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

    Default QML designer plugin: accessing QML designer objects inside my plugin source code;

    Hello;

    I'm building a plugin for Qt Quick Designer.

    I was able to successfully create the basic Qt Creator plugin (http://doc.qt.digia.com/qtcreator-ex...st-plugin.html). Now I want to access the QtQuick Designer classes exposed by the PlugIn Manager. I need to access the following QCreator and QtQuick designer objects from my code:

    - Object1: The vertical tab bar of QtCreator. This is the tab bar is already containing “Welcome”, “Design”, “Debug”, “Projects”, “Analyze”, “Help”.
    - Object2: “Library” dropdown list in Qt Quick Designer.
    - Object3: “main.qml” dropdown list Qt Quick Designer.
    - Object4: “Open Documents” dropdown list Qt Quick Designer.

    I'm not sure how to do that?

    Thank you for your help.

    Mut

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

    Default What are the QML Designer objects exposed in the Qt Creator pluginmanager?

    Hello;

    I'm building a plugin for Qt Quick Designer.

    I want to know the objects in pluginmanager that belong to Qt Quick Designer in order to access them in my own code?

    In particular: how to add items and handle selection for the case of these UI objects:

    - Object1: “Library” dropdown list
    - Object2: “main.qml” dropdown list
    - Object3: “Open Documents” dropdown list

    Thanks;

    Mut
    Last edited by mut; 9th June 2014 at 03:47.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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
    Yes, I'm writing a Qt Quick designer plugin. Within my code: I need to add my items into these Qt Quick designer objects:

    - Object1: “Welcome”, “Design”, “Debug”, “Projects”, “Analyze”, “Help” vertical tab bar.
    - Object2: “Library” dropdown list
    - Object3: “main.qml” dropdown list
    - Object4: “Open Documents” dropdown list
    You did not answer my question:

    Quote Originally Posted by wysota
    Do you want to extend Qt Quick Designer or substitute it with your own?
    Which of the two is it?
    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.


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

    Question What are the QML Designer objects exposed in the Qt Creator pluginmanager?

    Hello;

    I'm building a plugin for Qt Quick Designer.

    I want to know the objects in pluginmanager that belong to Qt Quick Designer in order to access them in my own code?

    In particular: how to add items and handle selection for the case of these UI objects:

    - Object1: “Library” dropdown list
    - Object2: “main.qml” dropdown list
    - Object3: “Open Documents” dropdown list

    Thanks;

    Mut http://doc.qt.io/qt-4.8/http://doc.qt.digia.com/qtcreator-extending/first-plugin.html

  10. #10
    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

    Thanks for the follow up. I want to extend Qt Quick Designer.

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

    Question Listing the objects of Qt Creator pluginmanager fails with crash;

    Hello;

    I'm building a plugin for Qt Quick Designer.

    I was able to successfully create the basic Qt Creator plugin (http://doc.qt.digia.com/qtcreator-ex...st-plugin.html). I want to list all the exposed objects of PlugInManager in order to track the ones
    related to QML designer.

    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]'

    Thanks;

    Mut

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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.


  13. #13
    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]'

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

    Question How to access QML designer object from my Qt creator plugin?

    Hello;

    I'm writing an extension plugin for QML designer.

    Hence I need to access the UI objects in QmlDesigner::QmlDesignerPlugin ?

    I'm trying to run the following code from my Qt Creator plugin:
    QmlDesigner::Internal:esignModeWidget *p = QmlDesigner::QmlDesignerPlugin::instance()->mainWidget();

    Problem is that the above piece of code fails with:

    -1: error: undefined reference to `_imp___ZN11QmlDesigner17QmlDesignerPlugin8instanc eEv'
    -1: error: undefined reference to `_imp___ZNK11QmlDesigner17QmlDesignerPlugin10mainW idgetEv'

    Help will be very much appreciated.

    Thanks;

    Mut.

  15. #15
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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.


  16. #16
    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

    Thanks for the reply. Your are right. This is the list of QML related exposed objects in the Qt Creator Plug In Manager:

    " (QmlJSTools::Internal::QmlConsolePane)"
    " (QmlJSTools::Internal::LocatorData)"
    " (QmlJSTools::Internal::FunctionFilter)"
    " (QmlJSTools::Internal::QmlJSCodeStyleSettingsPage) "
    " (QmlJSTools::BasicBundleProvider)"
    " (QmlJSEditor::Internal::QmlJSHighlighterFactory)"
    " (QmlJSEditor::Internal::QmlTaskManager)"
    " (QmlJSEditor::Internal::QmlJSEditorFactory)"
    " (QmlJSEditor::QmlFileWizard)"
    " (QmlJSEditor::QmlFileWizard)"
    " (QmlJSEditor::JsFileWizard)"
    " (QmlJSEditor::Internal::QmlJSCompletionAssistProvi der)"
    " (QmlJSEditor::Internal::HoverHandler)"
    " (QmlJSEditor::QmlJSQuickFixFactory)"
    " (QmlJSEditor::QmlJSQuickFixFactory)"
    " (QmlJSEditor::QmlJSQuickFixFactory)"
    " (QmlJSEditor::QmlJSQuickFixFactory)"
    " (QmlJSEditor::Internal::QmlJSOutlineWidgetFactory) "
    " (QmlJSEditor::QuickToolBar)"
    " (QmlJSEditor::Internal::QuickToolBarSettingsPage)"
    " (QmlDesigner::Internal::SettingsPage)"
    " (QmlProfiler::Internal::QmlProfilerRunControlFacto ry)"
    " (QmlProjectManager::Internal::Manager)"
    "QmlProjectRunConfigurationFactory (QmlProjectManager::Internal::QmlProjectRunConfigu rationFactory)"
    " (QmlProjectManager::Internal::QmlApplicationWizard )"


    Added after 14 minutes:


    However, I implemented
    class MyNavWidgetFactory : public Core::INavigationWidgetFactory
    {
    public:
    MyNavWidgetFactory ();
    ~MyNavWidgetFactory();

    virtual QString displayName() const;
    virtual int priority() const;
    virtual Core::Id id() const;
    virtual Core::NavigationView createWidget();
    };

    I works but it does not reach QML designer even if I see that QML designer uses this factory?
    Last edited by mut; 10th June 2014 at 23:44.

  17. #17
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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
    I works
    In what way does it "work"?

    but it does not reach QML designer
    What do you mean? How would it "reach" QML Designer?

    even if I see that QML designer uses this factory?
    How do you see that?
    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.


  18. #18
    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

    At the top of the thread I have attached an image of the QML designer dropdown list in which I want to add items. This what I means by reaching QML designer.


    Added after 15 minutes:


    It works means that the navigation widget shown below becomes populated with my new item MyNavWidgetFactory:

    NavigationWidget items.jpg
    Last edited by mut; 11th June 2014 at 17:17.

  19. #19
    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 Sorry. There is a change in my requirements. I no longer need go up to QML Designer, now I'm staying in core Qt Creator. I just need to add another tab (W1 in the image at the top of this thread and also inserted here) in the vertical tab widget containing “Welcome”, “Design”, “Debug”, “Projects”, “Analyze”, “Help”. The new tab page should be after Help and once selected W2, W3 and W4 should be displayed.
    Add another tab in this vertical tab widget.gif

  20. #20
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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
    At the top of the thread I have attached an image of the QML designer dropdown list in which I want to add items. This what I means by reaching QML designer.


    Added after 15 minutes:


    It works means that the navigation widget shown below becomes populated with my new item MyNavWidgetFactory:

    NavigationWidget items.jpg
    It still doesn't tell me what you want and what actually happens.
    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, 09:36
  2. Replies: 2
    Last Post: 5th October 2012, 14: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, 15:46
  4. Replies: 3
    Last Post: 13th September 2010, 22:14
  5. Replies: 1
    Last Post: 22nd January 2007, 13: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.