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. Help needed to connect slots and signals across qtplugins in my application
Forum Updated to NodeBB v4.3 + New Features

Help needed to connect slots and signals across qtplugins in my application

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 191 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.
  • K Offline
    K Offline
    krisby
    wrote on last edited by krisby
    #1

    I was wondering if there were any good tutorials that show how to connect to a signal emitted from one plugin in another plugin.

    I know how to do this in a normal application but not through an application that uses plugins.

    Example: i have an app that loads plugins at runtime and it has 2 plugins, One being a file system explorer and the second being a simple text editor. I have the ondblclicked event connected to emit a signal with the file path, however I cant seem to connect to this emitted signal in the text editor so i can load the file. I am using qt5 on linux.

    Much apreciated in advance

    Pl45m4P 1 Reply Last reply
    0
    • K krisby

      I was wondering if there were any good tutorials that show how to connect to a signal emitted from one plugin in another plugin.

      I know how to do this in a normal application but not through an application that uses plugins.

      Example: i have an app that loads plugins at runtime and it has 2 plugins, One being a file system explorer and the second being a simple text editor. I have the ondblclicked event connected to emit a signal with the file path, however I cant seem to connect to this emitted signal in the text editor so i can load the file. I am using qt5 on linux.

      Much apreciated in advance

      Pl45m4P Online
      Pl45m4P Online
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @krisby

      Hi and welcome,

      I was wondering if there were any good tutorials that show how to connect to a signal emitted from one plugin in another plugin.

      why do you need a tutorial to write a single line connect statement?
      You connect in the same way as you would connect other QObjects.

      I know how to do this in a normal application but not through an application that uses plugins.

      At some point you have to load your plugin with your app... then you have both plugins available and then you can connect them.

      Anyway, the idea of connecting two plugins with each other, seems like bad design.
      They should be connected to your main app and not with each other.
      On load, connect the plugin with some signal in your main app.

      Maybe there are even better or cleaner ways.

      Check out the DocumentViewer Example and how it's done there.
      (There is a ViewerFactory which loads different ViewerPlugins... and they also have signals connected)

      • https://doc.qt.io/qt-6/qtdoc-demos-documentviewer-example.html

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      K 1 Reply Last reply
      2
      • Pl45m4P Pl45m4

        @krisby

        Hi and welcome,

        I was wondering if there were any good tutorials that show how to connect to a signal emitted from one plugin in another plugin.

        why do you need a tutorial to write a single line connect statement?
        You connect in the same way as you would connect other QObjects.

        I know how to do this in a normal application but not through an application that uses plugins.

        At some point you have to load your plugin with your app... then you have both plugins available and then you can connect them.

        Anyway, the idea of connecting two plugins with each other, seems like bad design.
        They should be connected to your main app and not with each other.
        On load, connect the plugin with some signal in your main app.

        Maybe there are even better or cleaner ways.

        Check out the DocumentViewer Example and how it's done there.
        (There is a ViewerFactory which loads different ViewerPlugins... and they also have signals connected)

        • https://doc.qt.io/qt-6/qtdoc-demos-documentviewer-example.html
        K Offline
        K Offline
        krisby
        wrote on last edited by krisby
        #3
        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