Can I build qt plugin & load it in qt application?
-
Hey
I want to build a dll plugin for application that runs Qt framework but is not allowing for plugins... They have no SDK. I wonder if there is a way to build qt dll that could be loaded if placed in right place? I want to spawn a server/call local python functions. I have access to python in that app.Any idea if any kind of hot-wireing dll like that is possible?
-
Hi,
Do you mean that kind of plugin ?
-
Hi
Yes you can.
see this example (and reads the docs SGaist links)https://doc.qt.io/qt-6/qtwidgets-tools-plugandpaint-app-example.html
Here the drawing app is extended with extra plugsins.
Do note, however, that you will need to do as sample does in
"The next step is to load dynamic plugins"where is enumerate the files in a given folder using
const auto entryList = pluginsDir.entryList(QDir::Files); for (const QString &fileName : entryList) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); ...
so its not 100% automatic but almost ;)