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. How to release the plugin's dll file when application is running
Forum Updated to NodeBB v4.3 + New Features

How to release the plugin's dll file when application is running

Scheduled Pinned Locked Moved Solved General and Desktop
22 Posts 7 Posters 4.1k 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.
  • Q qtyangyong

    @Christian-Ehrlicher
    thans, I tried it but didn't solve the problem. Maybe the usage is incorrect.
    such as
    loader.setloadhints (0);
    loader.unload();

    Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #21

    @qtyangyong said in How to release the plugin's dll file when application is running:

    Maybe the usage is incorrect.

    For sure - they're load hints, not unload hints... set it before you load the library.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    1 Reply Last reply
    2
    • Q Offline
      Q Offline
      qtyangyong
      wrote on last edited by
      #22

      thank you very much, I moved "loader.setLoadHints(0);" before "loader.instance();", the problem was solved. the program such as below:
      int main(int argc, char *argv[])
      {
      ......
      QPluginLoader loader("ExtraFiltersPlugin.dll");
      loader.setLoadHints(0);
      QObject *plugin = loader.instance();
      if (plugin)
      {
      FilterInterface *fff = qobject_cast<FilterInterface *>(plugin);
      fff->test();
      }
      MainWindow w;
      w.ploader = &loader;
      ......
      }

      void MainWindow::on_unloadBtn_clicked()
      {
      ploader->unload();
      }

      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