Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDESIGNER_WIDGET_EXPORT macro usage
Forum Updated to NodeBB v4.3 + New Features

QDESIGNER_WIDGET_EXPORT macro usage

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 478 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DragoonD Offline
    DragoonD Offline
    Dragoon
    wrote on last edited by Dragoon
    #1

    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.html

    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.

    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.

    C 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      DragoonD 2 Replies Last reply
      0
      • DragoonD Dragoon

        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.html

        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.

        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.

        C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        @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 ;)

        DragoonD 1 Reply Last reply
        0
        • C ChrisW67

          @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 ;)

          DragoonD Offline
          DragoonD Offline
          Dragoon
          wrote on last edited by
          #4

          @ChrisW67 of course! The shorter the deadline the weirder the issues you got ! :-)

          1 Reply Last reply
          0
          • SGaistS SGaist

            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.

            DragoonD Offline
            DragoonD Offline
            Dragoon
            wrote on last edited by Dragoon
            #5

            @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.

            Christian EhrlicherC 1 Reply Last reply
            0
            • DragoonD Dragoon

              @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.

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Dragoon said in QDESIGNER_WIDGET_EXPORT macro usage:

              lead to this error... while compiling on Linux didn't.

              Which error?

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              DragoonD 1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                @Dragoon said in QDESIGNER_WIDGET_EXPORT macro usage:

                lead to this error... while compiling on Linux didn't.

                Which error?

                DragoonD Offline
                DragoonD Offline
                Dragoon
                wrote on last edited by
                #7

                @Christian-Ehrlicher forget it I was editing the reply...

                1 Reply Last reply
                0
                • SGaistS SGaist

                  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.

                  DragoonD Offline
                  DragoonD Offline
                  Dragoon
                  wrote on last edited by
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved