Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Accessing methods of a lib
QtWS25 Last Chance

Accessing methods of a lib

Scheduled Pinned Locked Moved General and Desktop
qtpluginfunction
3 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    brcontainer
    wrote on last edited by
    #1

    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 project: https://github.com/brcontainer/qt-helper

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      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
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      B 1 Reply Last reply
      3
      • dheerendraD dheerendra

        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.

        B Offline
        B Offline
        brcontainer
        wrote on last edited by brcontainer
        #3

        @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".

        QT project: https://github.com/brcontainer/qt-helper

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved