Workspace 6.21.5
Public Member Functions | List of all members
DockWidgetManager Class Reference

Registering a QDockWidget with a DockWidgetManager gives it the capability to float as a standalone floating widget. To activate floating, the user has to click on the QDockWidget and press ctrl-D. The floating widget can be docked by focusing on it and pressing ctrl-D again. More...

#include <Workspace/Widgets/DockWidget/dockwidgetmanager.h>

Inherits QObject.

Public Member Functions

 DockWidgetManager (QMainWindow &parent)
 
 ~DockWidgetManager () override
 
void addDockAction (QMenu &menu)
 
void loadFloatingDocks (QSettings &settings)
 
void registerDockWidget (QDockWidget &dockWidget)
 
void saveFloatingDocks (QSettings &settings) const
 

Detailed Description

To set up a DockWidgetManager for your application, you will need to add the dock action using addDockAction() which is preconfigured to use ctrl-D keyboard shortcut. You will then need to call registerDockWidget() for each QDockWidget that you wish to register with the manager to support floating capability. Finally, you will need to update your application serialization to call saveFloatingDocks() and loadFloatingDocks() prior to application shutdown and on application start up respectively to save/restore the state of any floating dock widgets between application sessions.

Constructor & Destructor Documentation

◆ DockWidgetManager()

DockWidgetManager ( QMainWindow &  parent)

◆ ~DockWidgetManager()

~DockWidgetManager ( )
override

Member Function Documentation

◆ addDockAction()

void addDockAction ( QMenu &  menu)

Adds a new action to the menu to dock widgets.

◆ loadFloatingDocks()

void loadFloatingDocks ( QSettings &  settings)

Restores the state of any registered floating dock widgets including their geometry.

◆ registerDockWidget()

void registerDockWidget ( QDockWidget &  dockWidget)
Parameters
dockWidgetThe supplied QDockWidget will be registered with this dock manager.

◆ saveFloatingDocks()

void saveFloatingDocks ( QSettings &  settings) const

Saves all currently floating dock widgets into a list of the originating QDockWidget object names, paired with each float dock widget's geometry.