Accessing methods of a lib
-
I build a QT project using
TEMPLATE = lib
and create a.dll
In other project usingTEMPLATE = app
I load this.dll
, but I don't know how to retrieve returns from methods/functions from this.dll
.To be clear I have compiled library is: https://github.com/QupZilla/qtwebkit-plugins
I need retrieve
QStringList
from this methodQStringList suggest(const QString &word);
(inspeller.h
) for my application.How to return the variables of DLLs for main application?
-
Hope you have built plugin and plugin is loaded using the QPluginLoader. You need to get a instance to QObject and type cast to required interface. Once you have the interface variable, you can directly call method which return the required string.
-
@dheerendra said:
You need to get a instance to QObject and type cast to required interface.
From plugin? The QT automatically loads the plugin (
qtdir/plugins/webkit/qwebkitplatformplugin.dll
), do not know if it is usedQPluginLoader
, I noticed that if I addqdebug() << "test";
indll
it shows in the main console application, maybe I can useQApplication
to share "data".