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. A lot of plugins questions.
Qt 6.11 is out! See what's new in the release blog

A lot of plugins questions.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.5k Views 1 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.
  • L Offline
    L Offline
    laumaya
    wrote on last edited by
    #1

    Hello all,
    I have some questions to Qt4 masters,
    I'm the developer of "GLC_lib":http://www.glc-lib.net and "GLC_Player":http://www.glc-player.net... From now, I need to use more powerful functionality of Qt4.
    To do that, I have done some research and I'haven't found clear answer about plugin's related questions :

    Can I use Plugins in a DLL which depend of this DLL (ia GLC_lib plugins which depends of GLC_lib)

    It's possible to catch exceptions in a plugin ?

    It's possible to use more than one interface in a plugin implementation ?

    It's possible to send signals to a plugin class ?

    If yes, where I should declare signals ? (In the interface or in the implementation of the plugin or somewhere else?)

    It's possible to receive signals from a plugin class ?

    If yes, where I should declare signals ? (In the interface or in the implementation of the plugin or somewhere else?)

    It's possible to use a powerful plugin class which use a some QWidget with Signals and Slots ?

    And finally, if the answer is yes have you some samples ?

    Thanks.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      bq. Can I use Plugins in a DLL which depend of this DLL (ia GLC_lib plugins which depends of GLC_lib)

      Yes.

      bq. It's possible to catch exceptions in a plugin ?

      Yes. To be useful you would have to know the type of exception. When in doubt, you can do catch(...) but that might also catch exceptions that you don't know how to handle.
      @try {
      myPlugin->doSomething();
      } catch(SomeException &ex) {
      qWarning("Exception occurred");
      }@

      bq. It's possible to use more than one interface in a plugin implementation ?

      Yes.
      @class MyPlugin : public Interface1, public Interface2, public QObject
      {
      Q_OBJECT
      Q_INTERFACES(Interface1 Interface2)

      // The rest of your class implementation
      

      };@

      bq. It's possible to send signals to a plugin class ?

      Yes. You can send signals everywhere. Or better said, you can connect signals and slots to any signal you can access.

      bq. If yes, where I should declare signals ? (In the interface or in the implementation of the plugin or somewhere else?)

      You declare signals in the class you emit them from.

      bq. It's possible to receive signals from a plugin class ?

      Yes.

      bq. If yes, where I should declare signals ? (In the interface or in the implementation of the plugin or somewhere else?)

      Declare them in your plug-in implementation. One of the drawbacks of the plug-in system is that you cannot publicly declare signals and slots without the plug-in being dependent on a dll that implements the QObject part of the interface.

      @class MyPlugin : public Interface1, public QObject
      {
      Q_OBJECT
      Q_INTERFACES(Interface1)

      Q_SIGNALS:
      void progressChanged(int);

      // The rest of your class implementation
      

      };@

      bq. It's possible to use a powerful plugin class which use a some QWidget with Signals and Slots ?

      Yes.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • L Offline
        L Offline
        laumaya
        wrote on last edited by
        #3

        Thanks a lot Franzk.

        Now, it's clear for me. Qt does all the things I need with plugin.

        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