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 correctly kill plugins with their windows?
Forum Updated to NodeBB v4.3 + New Features

How to correctly kill plugins with their windows?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.6k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    Gourmand
    wrote on last edited by
    #1

    Main application loads bunch of plugins. Most of them have their own UIs and windows appear on screen. When application ends I have close all plugins window and kill all plugins threads if any running. I'm thinking how better do that... As I see - when I close main app window but plugins window exist (even one) - then application is still running. Probably all loaded plugins run too. All finishes when I close last window regardless of is it main window or plugin window. I'm going create a set of slots in plugins to connect them to on_MainWindow_destroyed() signals. And connect them between plugins to allow any of them close others. But I'm not sure - will this correctly close application and destroy all plugins when last window close? Anybody can comment this?

    1 Reply Last reply
    0
    • jensen82J Offline
      jensen82J Offline
      jensen82
      wrote on last edited by
      #2

      If you shutdown the mainwindow, all childwindows will be destroyed, too. If you got some instances of YourClass, created with new, you have to delete them yourself or use smartpointers.

      1 Reply Last reply
      0
      • jensen82J Offline
        jensen82J Offline
        jensen82
        wrote on last edited by
        #3

        And child of childs, too!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Gourmand
          wrote on last edited by
          #4

          I did not tell - plugins windows are not children of main app window. They are independent windows without parent. They should work on different monitors. Without parent/child relation to main window they are not closed with it.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Gourmand
            wrote on last edited by
            #5

            for while I created little complex network of signals emited from closeEvent() overloaded methods, and slots to close each other window in it's own manner with confirmation to main window, looks like all works fine

            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