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. [SOLVED] One dll for every single plugin ?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] One dll for every single plugin ?

Scheduled Pinned Locked Moved General and Desktop
plugins
5 Posts 2 Posters 2.1k 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote on last edited by Andy314
    #1

    I will start with my first custom widget plugin.
    Is it really correct that I cannot pack multiple custom widgets in one project.

    Respectively, how is the configuration made, which QDesignerCustomWidgetInterface -subclass of the project should be instantiated?
    There is no special instantiation code for it in the AnalogClock example.
    or where is the dll startcode ?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by Chris Kawa
      #2

      how is the configuration made, which QDesignerCustomWidgetInterface -subclass of the project should be instantiated?

      This is done via the Q_PLUGIN_METADATA macro. There can be only one instance of it in the library and it exports the class it is declared in.

      Is it really correct that I cannot pack multiple custom widgets in one project.

      Not at all. Multiple classes can be contained in a single project. You would then create another class that implements QDesignerCustomWidgetCollectionInterface (what a mouthful...) and put the Q_PLUGIN_METADATA in it. It is a collection object that can expose multiple classes implementing QDesignerCustomWidgetInterface.
      I suggest you try to create a ui plugin via Qt Creator's wizard. It has a really nice interface that lets you add multiple plugin classes and generates all the crust. Add a couple of classes and study generated output. It is pretty straightforward.

      Andy314A 1 Reply Last reply
      0
      • Chris KawaC Chris Kawa

        how is the configuration made, which QDesignerCustomWidgetInterface -subclass of the project should be instantiated?

        This is done via the Q_PLUGIN_METADATA macro. There can be only one instance of it in the library and it exports the class it is declared in.

        Is it really correct that I cannot pack multiple custom widgets in one project.

        Not at all. Multiple classes can be contained in a single project. You would then create another class that implements QDesignerCustomWidgetCollectionInterface (what a mouthful...) and put the Q_PLUGIN_METADATA in it. It is a collection object that can expose multiple classes implementing QDesignerCustomWidgetInterface.
        I suggest you try to create a ui plugin via Qt Creator's wizard. It has a really nice interface that lets you add multiple plugin classes and generates all the crust. Add a couple of classes and study generated output. It is pretty straightforward.

        Andy314A Offline
        Andy314A Offline
        Andy314
        wrote on last edited by
        #3

        @Chris-Kawa
        Oh, fine !
        Must I use the wizzard template : Library -> Qt Creator Plugin

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          No. It's under Other Projects -> Qt Custom Designer Widget.

          Andy314A 1 Reply Last reply
          0
          • Chris KawaC Chris Kawa

            No. It's under Other Projects -> Qt Custom Designer Widget.

            Andy314A Offline
            Andy314A Offline
            Andy314
            wrote on last edited by
            #5

            @Chris-Kawa
            Wow, never seen before.
            Can I reopen the powerfull wizzard for a just created project again to add new classes incl. plugins ? It seem not to be possible.

            To the QDesignerCustomWidgetCollectionInterface:
            I change the project to importing only the interface "with the long name" and must remove the Q_PLUGIN_METADATA macro of all single widgets!

            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