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. Plugin architecture question

Plugin architecture question

Scheduled Pinned Locked Moved Solved General and Desktop
qmlpluginsc++qt5.9
4 Posts 3 Posters 1.7k 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.
  • ArasA Offline
    ArasA Offline
    Aras
    wrote on last edited by
    #1

    I am developing qt application that requires many API's that are only accessible through the C++ APIs, but the application UI is all with QML. So I am developing plugins to bring those API's to my QML code. I am noticing now that some plugins are becoming too large. For example we have a plugin that deals with communication protocol, but there are several issues around the communication such as error handling, handling communication for a particular hardware such as a joystick or a PLC. I think I should keep the plugins small and focused, but since so many plugins depend on the communication layer, I seem to have to put them in one plugin.

    My question is, can I create a plugin just for handling communication protocol and then reuse that plugin from other plugins in my application? If so, could you explain briefly how this can be achieved?

    kshegunovK 1 Reply Last reply
    0
    • ArasA Aras

      I am developing qt application that requires many API's that are only accessible through the C++ APIs, but the application UI is all with QML. So I am developing plugins to bring those API's to my QML code. I am noticing now that some plugins are becoming too large. For example we have a plugin that deals with communication protocol, but there are several issues around the communication such as error handling, handling communication for a particular hardware such as a joystick or a PLC. I think I should keep the plugins small and focused, but since so many plugins depend on the communication layer, I seem to have to put them in one plugin.

      My question is, can I create a plugin just for handling communication protocol and then reuse that plugin from other plugins in my application? If so, could you explain briefly how this can be achieved?

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @Aras said in Plugin architecture question:

      My question is, can I create a plugin just for handling communication protocol and then reuse that plugin from other plugins in my application? If so, could you explain briefly how this can be achieved?

      If you mean can a plugin load other plugins, then yes. The procedure is exactly the same as you do it in the application. You provide the interface headers, load the plugins with QPluginLoader and then use them. There's nothing special about it. If you mean something else, please elaborate on what you mean by "reuse".

      Read and abide by the Qt Code of Conduct

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

        Hi,

        To add to @kshegunov, it seems that you should split the communication part in a dynamic library and link your plugins against it, no ?

        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
        3
        • ArasA Offline
          ArasA Offline
          Aras
          wrote on last edited by
          #4

          @kshegunov yes that is exactly what I was wondering. I was not sure if plugins can be loaded into other C++ plugins or not. I will give this a shot.

          @SGaist good point about creating a library. I think isolating the communication API into a dynamic library would be an even better solution as you suggested. I will have to do some refactoring.

          Thank you both for sharing the quick and helpful response!

          1 Reply Last reply
          1

          • Login

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