Help needed to connect slots and signals across qtplugins in my application
-
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
-
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
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 otherQObjects
.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 aViewerFactory
which loads differentViewerPlugins
... and they also have signals connected) -
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 otherQObjects
.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 aViewerFactory
which loads differentViewerPlugins
... and they also have signals connected)