Important: Please read the Qt Code of Conduct -

How to include plugin

  • Hello Qt community.

    I build echoplugin example and get echoplugin.dll.

    Now I'm trying to use plugin from new application.
    How to include plugin in new application?

  • Hello,
    You should use QPluginLoader (with Qt 4, in don't know yet in Qt5) pass the library file to the constructor or to setFileName() and then call instance().
    If you did all this then you can use the object you got as a normal object and call its methods (and even meta-methods)
    Hope this is detailed enough to help you.

  • Moderators

    you may want to read "this": for a better understanding.

    Also what would be good to know is:
    Do you want to use it as plugin? Meaning to load it automatically only if it's present in the system? And if it's not present you jsut miss the functionality in your applciation. If so you should use QPluginLoader or QLibrary (if it contains C-exportetd symbols).

    If you want to make it an dependency of your application (something your application can't run without it) you would need to link to the library. Then read "this":

Log in to reply