[Interest] using designer plugin in application

Harish Surana surana4u at gmail.com
Tue Dec 3 12:12:59 CET 2013


If you look for QDESIGNER_WIDGET_EXPORT in the documentation. You will get:
QDESIGNER_WIDGET_EXPORT

This macro is used when defining custom widgets to ensure that they are
correctly exported from plugins for use with *Qt Designer*.

On some platforms, the symbols required by *Qt Designer* to create new
widgets are removed from plugins by the build system, making them unusable.
Using this macro ensures that the symbols are retained on those platforms,
and has no side effects on other platforms.

For example, the World Time Clock
Plugin<qthelp://com.trolltech.qt.484/qdoc/designer-worldtimeclockplugin.html>
 example exports a custom widget class with the following declaration:

 class QDESIGNER_WIDGET_EXPORT WorldTimeClock : public QWidget
<qthelp://com.trolltech.qt.484/qdoc/qwidget.html>
 {
     Q_OBJECT
     ...
 };




On Tue, Dec 3, 2013 at 12:00 PM, Graham Labdon <
Graham.Labdon at avalonsciences.com> wrote:

>  Hi
>
> I have read this but cannot get it to work (I am using Qt5.1.1 with Visual
> Studio
>
> I have a library called Widgets.dll that contains 1 class declared as
>
> #include <QLabel>
>
> #include "widgets_global.h"
>
>
>
> class WIDGETS_EXPORT MyLabel : public QLabel
>
> {
>
>                Q_OBJECT
>
>
>
> public:
>
>                MyLabel(QWidget *parent);
>
>                ~MyLabel();
>
>
>
> private:
>
>
>
> };
>
> I have set up my plugin project so that it can see the header file for
> MyLabel and can see the Widgets.lib
>
> The plugin project builds without error but is not visible in Designer
>
> Can anyone see the reason for this?
>
>
>
> Thanks
>
>
>
> *From:* Harish Surana [mailto:surana4u at gmail.com]
> *Sent:* 03 December 2013 10:20
> *To:* Graham Labdon
> *Cc:* interest at qt-project.org
> *Subject:* Re: [Interest] using designer plugin in application
>
>
>
> Yes it is technically possible to make the widgets accessible to Qt
> Designer without linking *widgets dll* against *QtDesigner4.dll*. Some
> possible approaches are described here:
> http://qt-project.org/doc/qt-4.8/designer-creating-custom-widgets.html(see the section "Splitting up the Plugin").
>
>
>
> On Tue, Dec 3, 2013 at 10:31 AM, Graham Labdon <
> Graham.Labdon at avalonsciences.com> wrote:
>
> Hi
>
> I have developed a number of Qt Designer plugins and can use them in my
> applications.
>
> But obviously I need my apps to link against the plugin library which
> means when I deploy the application I need to deploy the plugin library as
> well.
>
> What I would like is for widget classes to be compiled into one library
> that both the application and the designer plugin can use but I have been
> unable to achieve this.
>
> Is this possible?
>
>
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131203/4f57bd9d/attachment.html>


More information about the Interest mailing list