To integrate a custom widget with Qt Designer, you require a suitable description for the widget and an appropriate project file.
-
Does the project file need to be a DLL or can it be an EXE? What modules should we include? How about core;gui;widgets;sql;charts;designer?
I am using VS Tools for Qt... which project type should I create?
Qt Designer custom widget?
Qt Class Library?
Qt Widgets application?
It seems to me that the first is the correct one... am I right? don't I need to export the custom widget? in VS that would mean __declspec(dllexport) but that is not present in the generated code....?? maybe there is some macro in Qt for this.....
-
Since you took the title of this topic from here, I think you already found the documentation page about creating Qt Designer Plugins.
How about core;gui;widgets;sql;charts;designer?
Here is an example:
You also need
Qt::UiPlugin
and need to install your app to the place where your Qt Designer looks for plugins (
QT_INSTALL_PLUGINS
/QT6_INSTALL_PLUGINS
).Here you can find another simple but complete plugin example:
-
@Pl45m4 only one thing: which project type should I create in Visual Studio? Qt Designer custom widget? do we need to export the widget?
__declspec(dllexport)??
The only problem is the examples are for use in Qt Creator I think while I am in Visual Studio... is there a VS example?
How can I find the value of the macros like $$[QT_INSTALL_PLUGINS] and ${INSTALL_EXAMPLEDIR}?