How to close QDockWidget from code?
Solved
General and Desktop
-
I have an app with a main window and several helper windows displayed in QDockWidgets. I'm trying to implement a menu I can use to toggle whether a particular helper window is visible.
My helper windows are QWidgets placed inside QDockWidgets. I've tried calling
close()
anddeleteLater()
on the QDockWidget (when I select a menu option), but it is not removed from the main window. I've also calledmyDock->setAttribute(Qt::WA_DeleteOnClose);
, but that did not help either.How can I close my dock pane?