Destroy QWidget returned from Plugin in Qt
-
30-05-2021 - |
سؤال
My app loads a plugin which creates a window (QWidget
), but I can not destroy it when I exit from QMainWindow
, obviously because widget returned from plugin is not a child of QMainWindow
. The issue is that if I make that window to be a child of mainwindow, I get a window on another window. But I need them both to be separated. I did them separated (but main window has no control over window from plugin), in my case I do not know how to close window from plugin when app quits. How can I achieve that?
المحلول
Just delete it. If you don't assign it a parent, no other widget has ownership. So you should simply be able to destroy it yourself on exit.
لا تنتمي إلى StackOverflow