QDESIGNER_WIDGET_EXPORT macro usage
-
Re: QDESIGNER_WIDGET_EXPORT causes dll linkage errors
as previously discussed in the referenced topic I found a problem using the macro
QDESIGNER_WIDGET_EXPORT
when compiling under Windows.As stated at the bottom of the page:
https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.htmlThis 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.
What's the point then?
This macro should be used or NOT when creating custom widgets?
Which platforms are included in some platforms?The comments about this practice in the previous post are a little confusing.
-
Hi,
See the World Time Clock plugin example.
My educated guess of some platform is mainly Windows. Symbols are not exported by default so you will end up with an unusable plugin hence the suggestion to use the macro anyway.
-
Re: QDESIGNER_WIDGET_EXPORT causes dll linkage errors
as previously discussed in the referenced topic I found a problem using the macro
QDESIGNER_WIDGET_EXPORT
when compiling under Windows.As stated at the bottom of the page:
https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.htmlThis 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.
What's the point then?
This macro should be used or NOT when creating custom widgets?
Which platforms are included in some platforms?The comments about this practice in the previous post are a little confusing.
-
@Dragoon said in QDESIGNER_WIDGET_EXPORT macro usage:
Which platforms are included in some platforms?
In my experience, it will be whatever platform you are using when you are working to a looming deadline ;)
-
Hi,
See the World Time Clock plugin example.
My educated guess of some platform is mainly Windows. Symbols are not exported by default so you will end up with an unusable plugin hence the suggestion to use the macro anyway.
-
@SGaist
I found the issue... the macro should be applied only when compiling it for the plugin production. My fault was to leave it also in code that I use to test the widget NOT using plugin.@Dragoon said in QDESIGNER_WIDGET_EXPORT macro usage:
lead to this error... while compiling on Linux didn't.
Which error?
-
@Dragoon said in QDESIGNER_WIDGET_EXPORT macro usage:
lead to this error... while compiling on Linux didn't.
Which error?
@Christian-Ehrlicher forget it I was editing the reply...
-
Hi,
See the World Time Clock plugin example.
My educated guess of some platform is mainly Windows. Symbols are not exported by default so you will end up with an unusable plugin hence the suggestion to use the macro anyway.