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. Custom Widget and #include error in the ap

Custom Widget and #include error in the ap

Scheduled Pinned Locked Moved Unsolved General and Desktop
custom widgetpluginqtcreator 3.6.1qt5.6
2 Posts 2 Posters 1.1k Views
  • 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.
  • M Offline
    M Offline
    maurofaresoftware.it
    wrote on last edited by
    #1

    Hi all.
    I build my custom widget XLabel, derived from a QLabel.
    I create libxlabelplugin.so and I use it in Designer.

    When I compile the project the linker cannot find XLabel::XLabel because it is implemented in libxlabelplugin.so.

    How can I tell to the linker to link libxlabelplugin?

    This is the tree of the project

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

      Hi,

      You followed the "simple way" of creating a Designer plugin.

      For a "real world" approach take a look at this.

      Short version: you split your plugin code in two:

      1. a library which will include your widget(s)
      2. the plugin itself

      That way you have the plugin for designer and you can link your application to the library which will not have any dependency on designer related code.

      Hope it helps

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

      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