Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Accessing methods of a lib



  • I build a QT project using TEMPLATE = lib and create a .dll
    In other project using TEMPLATE = 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 method QStringList suggest(const QString &word); (in speller.h) for my application.

    How to return the variables of DLLs for main application?


  • Qt Champions 2017

    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 used QPluginLoader, I noticed that if I add qdebug() << "test"; in dll it shows in the main console application, maybe I can use QApplication to share "data".


Log in to reply