Plugin is not loading automatically
-
wrote on 15 May 2023, 17:54 last edited by
I'm developing a plugin based off of the TuioTouch generic plugin that comes standard in Qt. My plugin does a similar task of reading in data from a device and converting them into Qt touches.
The plugin works fine, but so far I can't get it to load automatically. I definitely have it installed in the correct place for Qt to find it. Even so, it only ever loads if I launch the app with a command line argument that explicitly enables it, like:
./myApp -plugin myPluginName
Is there something else I need to do to get it to load without using a command line argument?
-
@SGaist said in Plugin is not loading automatically:
Hi,
Qt's plugin do not get all auto loaded at runtime. There usually a reason for that like adding a new database connection will load the corresponding plugin at that time.
What exact type of plugin are building ?
As far as I know, it's a generic plugin, in that it goes into the plugins/generic directory and inherits from QGenericPlugin, if that answers the question. I'm still new to plugins so a) I don't know if there's a more specific answer to your question, and b) I don't know if this is the right class to inherit from.
I'm imitating what was done in the TuioTouch plugin that comes with Qt, since I figured that was a good starting point. My plugin does almost the same thing, except rather than receiving touches from a TUIO server and converting them to Qt touch events, it receives touches using a third party API I'm working with.
That's what I wanted to know.
One thing you can do is make use of the ˋQT_QPA_GENERIC_PLUGINS` environment variable to load your plugin.
If it's mandatory for your application, you can set that variable in your main function before creating the QApplication object.
-
I'm developing a plugin based off of the TuioTouch generic plugin that comes standard in Qt. My plugin does a similar task of reading in data from a device and converting them into Qt touches.
The plugin works fine, but so far I can't get it to load automatically. I definitely have it installed in the correct place for Qt to find it. Even so, it only ever loads if I launch the app with a command line argument that explicitly enables it, like:
./myApp -plugin myPluginName
Is there something else I need to do to get it to load without using a command line argument?
Hi,
Qt's plugin do not get all auto loaded at runtime. There usually a reason for that like adding a new database connection will load the corresponding plugin at that time.
What exact type of plugin are building ?
-
Hi,
Qt's plugin do not get all auto loaded at runtime. There usually a reason for that like adding a new database connection will load the corresponding plugin at that time.
What exact type of plugin are building ?
wrote on 15 May 2023, 19:27 last edited by@SGaist said in Plugin is not loading automatically:
Hi,
Qt's plugin do not get all auto loaded at runtime. There usually a reason for that like adding a new database connection will load the corresponding plugin at that time.
What exact type of plugin are building ?
As far as I know, it's a generic plugin, in that it goes into the plugins/generic directory and inherits from QGenericPlugin, if that answers the question. I'm still new to plugins so a) I don't know if there's a more specific answer to your question, and b) I don't know if this is the right class to inherit from.
I'm imitating what was done in the TuioTouch plugin that comes with Qt, since I figured that was a good starting point. My plugin does almost the same thing, except rather than receiving touches from a TUIO server and converting them to Qt touch events, it receives touches using a third party API I'm working with.
-
@SGaist said in Plugin is not loading automatically:
Hi,
Qt's plugin do not get all auto loaded at runtime. There usually a reason for that like adding a new database connection will load the corresponding plugin at that time.
What exact type of plugin are building ?
As far as I know, it's a generic plugin, in that it goes into the plugins/generic directory and inherits from QGenericPlugin, if that answers the question. I'm still new to plugins so a) I don't know if there's a more specific answer to your question, and b) I don't know if this is the right class to inherit from.
I'm imitating what was done in the TuioTouch plugin that comes with Qt, since I figured that was a good starting point. My plugin does almost the same thing, except rather than receiving touches from a TUIO server and converting them to Qt touch events, it receives touches using a third party API I'm working with.
That's what I wanted to know.
One thing you can do is make use of the ˋQT_QPA_GENERIC_PLUGINS` environment variable to load your plugin.
If it's mandatory for your application, you can set that variable in your main function before creating the QApplication object.
-
That's what I wanted to know.
One thing you can do is make use of the ˋQT_QPA_GENERIC_PLUGINS` environment variable to load your plugin.
If it's mandatory for your application, you can set that variable in your main function before creating the QApplication object.
wrote on 15 May 2023, 19:54 last edited by@SGaist said in Plugin is not loading automatically:
That's what I wanted to know.
One thing you can do is make use of the ˋQT_QPA_GENERIC_PLUGINS` environment variable to load your plugin.
If it's mandatory for your application, you can set that variable in your main function before creating the QApplication object.
Thanks!
Can you say whether there's a better type of plugin for me to use for this?
-
@SGaist said in Plugin is not loading automatically:
That's what I wanted to know.
One thing you can do is make use of the ˋQT_QPA_GENERIC_PLUGINS` environment variable to load your plugin.
If it's mandatory for your application, you can set that variable in your main function before creating the QApplication object.
Thanks!
Can you say whether there's a better type of plugin for me to use for this?
@Guy-Gizmo i think you selected the right one.
-
-
1/6