I have an application with multiple docked widgets, opened from a menu. When I right click on a dock title bar, I get a checked menu of opened docks, which can be hidden/shown by selecting them. I'm trying to find a way to get this on a menu in the main window, but can't find anywhere this dock menu is created. I figure if I can it's name, or a function to return a pointer to it, I can can add it to the menu I want. Any suggestions?

I'm also looking for a way to close (delete) the dock when it has been unselected from this menu. I've tried connecting a slot to the visibilityChanged(bool) signal, but this seems to trigger false when moving the dock. Otherwise it works fine. If figure I can fix this problem once I find out how to use the dock menu.