How to integrate Qt Designer into an external IDE
-
Hi all,
I'm planning to integrate Qt Designer into an external IDE. Does anyone have experience with this? For starters, what classes/functions do I use to create an instance of Qt Designer?
I had a quick look, and the classes at http://doc.qt.io/qt-5/qtdesigner-module.html seem mainly for extending Qt Designer itself. I also glanced through the source code for Qt Creator and the Visual Studio Add-In but nothing jumped out immediately, so I thought I'd ask before plunging into the depths of the code.
-
Hi
Nice project. o.O
Can I ask if you mean the standalone "exe" of Designer
as seen in Qt4? or the plugin version of the same
as used in Qt Creator Qt5.ish ?
Creator seems to be one giant plugin loader so embedding into external IDE could
in theory be realized by loaded as plugin if other IDE is Qt based.
I assume you already know more of Creator then I do, i'm just curious :) -
@JKSH
Hello,
I haven't any experience with this, but I'd start with taking a look at how Qt Creator integrates it. It looks like there's a plugin for creator that instantiates QDesignerFormEditorInterface which seems, at least to me, to be the entry point for all of the designer's functionality.
... but as @mrjj said you probably know Qt better than most ... so I don't know how much help would we/I be.Kind regards.
-
Hi,
To add to my fellows, what IDE would that be ? :)
-
Thanks, guys :) Qt is a massive toolkit though, and there are many things within it that I've never used before! (I've spent very little time in Qt Creator's code base, so I probably have the same amount of experience as you in this area) Anyway, it's more fun to involve the community than to tinker alone in my basement.
It's the LabVIEW IDE, for which I'm writing language bindings for: https://lavag.org/topic/19611-utf-8-text-svg-images-inheritable-gui-components-dynamically-composed-guis-layout-management-splitters-in-tabs-mdis-taskbar-integration-and-much-more/ (I was hoping for a stronger reaction from the LabVIEW community, but this is a good start)
LabVIEW is a (proprietary) dataflow language that I use in my day job. It's great for controlling industrial hardware, industrial comms, data acquisition, data processing, etc. You can also use it to get a GUI up and running very very quickly. However, its GUIs aren't very flexible -- this is where Qt shines.
@mrjj said:
Can I ask if you mean the standalone "exe" of Designer
as seen in Qt4? or the plugin version of the same
as used in Qt Creator Qt5.ish ?I'm leaning towards the plugin version, as that would enable two-way comms between the IDE and Qt Designer. The standalone .exe might be easier to implement in the short term, though (but it doesn't seem to exist in Qt 5 anymore).
@kshegunov said:
I'd start with taking a look at how Qt Creator integrates it. It looks like there's a plugin for creator that instantiates QDesignerFormEditorInterface which seems, at least to me, to be the entry point for all of the designer's functionality.
Awesome; that's the perfect starting point, thanks!
It looks like there isn't a single pre-defined widget that Qt Creator instantiates, so Creator implements its own wrapper widget to manage the different components of Qt Designer: http://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/designer/editorwidget.cpp
-
@JKSH said:
It looks like there isn't a single pre-defined widget that Qt Creator instantiates, so Creator implements its own wrapper widget to manage the different components of Qt Designer.
I think this is because they want it fancy (like adding things to dock(s)). :)
See for example:
http://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/designer/formeditorw.cpp#n231
http://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/designer/formeditorw.cpp#n368
http://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/designer/formeditorw.cpp#n455
http://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/designer/formeditorw.hIt appears in Creator there's a wrapper in place for the designer widget and its subcomponents. I can't blame them though, because at least it puts the introspection in one place and provides a more convenient way of treating the various subwidgets.
I do believe however that only for testing you could try embeding the top-level widget and seeing how that fares. I'd assume that it should at least show the designer. Although, while skimming through the source I wasn't able to see where they are instantiating the
QDesignerFormEditor
, perhaps there's a plugin-loading somewhere that I missed.Kind regards.