I was taking a look at the Dock Widgets example that comes with Qt. It can be found here.
In MainWindow::createDockWindows() a QDockWidget instance is created and its address is passed to a pointer called 'dock'. The main window has a menu item called 'view' that shows a toggle action to show or hide the available dockwidgets. It adds the toggle item to the menu with this: viewMenu->addAction(dock->toggleViewAction());
Suppose that in another application, a few particular dockwidgets are created at runtime. If i did the same way as the example, the toggle items for each particular dockwidget would only show in the viewMenu after they are created, but I'd like to have them exist even when the dockwidget itself haven't been created yet. The item in the viewMenu would be inert, but would work after the dockwidget is created. How can I do that?
Bookmarks