#include <DockManager.h>
Public Slots | |
void | openPerspective (const QString &PerspectiveName) |
void | setDockWidgetFocused (CDockWidget *DockWidget) |
Signals | |
void | dockAreaCreated (ads::CDockAreaWidget *DockArea) |
void | dockWidgetAboutToBeRemoved (ads::CDockWidget *DockWidget) |
void | dockWidgetAdded (ads::CDockWidget *DockWidget) |
void | dockWidgetRemoved (ads::CDockWidget *DockWidget) |
void | floatingWidgetCreated (ads::CFloatingDockContainer *FloatingWidget) |
void | focusedDockWidgetChanged (ads::CDockWidget *old, ads::CDockWidget *now) |
void | openingPerspective (const QString &PerspectiveName) |
void | perspectiveListChanged () |
void | perspectiveOpened (const QString &PerspectiveName) |
void | perspectivesRemoved () |
void | restoringState () |
void | stateRestored () |
Signals inherited from ads::CDockContainerWidget | |
void | dockAreasAdded () |
void | dockAreasRemoved () |
void | dockAreaViewToggled (ads::CDockAreaWidget *DockArea, bool Open) |
Static Public Member Functions | |
static ConfigFlags | configFlags () |
static CIconProvider & | iconProvider () |
static void | setConfigFlag (eConfigFlag Flag, bool On=true) |
static void | setConfigFlags (const ConfigFlags Flags) |
template<class QWidgetPtr > | |
static void | setWidgetFocus (QWidgetPtr widget) |
static int | startDragDistance () |
static bool | testConfigFlag (eConfigFlag Flag) |
Private Attributes | |
DockManagerPrivate * | d |
private data (pimpl) More... | |
Friends | |
class | CDockAreaTabBar |
class | CDockAreaTitleBar |
class | CDockContainerWidget |
class | CDockWidgetTab |
class | CFloatingDockContainer |
class | CFloatingDragPreview |
struct | DockAreaWidgetPrivate |
class | DockContainerWidgetPrivate |
struct | DockManagerPrivate |
struct | DockWidgetTabPrivate |
struct | FloatingDockContainerPrivate |
struct | FloatingDragPreviewPrivate |
The central dock manager that maintains the complete docking system. With the configuration flags you can globally control the functionality of the docking system. The dock manager uses an internal stylesheet to style its components like splitters, tabs and buttons. If you want to disable this stylesheet because your application uses its own, just call the function for settings the stylesheet with an empty string.
Definition at line 69 of file DockManager.h.
Definition at line 144 of file DockManager.h.
These global configuration flags configure some global dock manager settings. Set the dock manager flags, before you create the dock manager instance.
Definition at line 157 of file DockManager.h.
Enumerator | |
---|---|
MenuSortedByInsertion | |
MenuAlphabeticallySorted |
Definition at line 146 of file DockManager.h.
ads::CDockManager::CDockManager | ( | QWidget * | parent = nullptr | ) |
Default Constructor. If the given parent is a QMainWindow, the dock manager sets itself as the central widget. Before you create any dock widgets, you should properly setup the configuration flags via setConfigFlags().
Definition at line 478 of file DockManager.cpp.
|
overridevirtual |
Virtual Destructor
Definition at line 506 of file DockManager.cpp.
CDockAreaWidget * ads::CDockManager::addDockWidget | ( | DockWidgetArea | area, |
CDockWidget * | Dockwidget, | ||
CDockAreaWidget * | DockAreaWidget = nullptr |
||
) |
Adds dockwidget into the given area. If DockAreaWidget is not null, then the area parameter indicates the area into the DockAreaWidget. If DockAreaWidget is null, the Dockwidget will be dropped into the container. If you would like to add a dock widget tabified, then you need to add it to an existing dock area object into the CenterDockWidgetArea. The following code shows this:
Definition at line 758 of file DockManager.cpp.
CFloatingDockContainer * ads::CDockManager::addDockWidgetFloating | ( | CDockWidget * | Dockwidget | ) |
Adds the given DockWidget floating and returns the created CFloatingDockContainer instance.
Definition at line 715 of file DockManager.cpp.
CDockAreaWidget * ads::CDockManager::addDockWidgetTab | ( | DockWidgetArea | area, |
CDockWidget * | Dockwidget | ||
) |
This function will add the given Dockwidget to the given dock area as a new tab. If no dock area widget exists for the given area identifier, a new dock area widget is created.
Definition at line 770 of file DockManager.cpp.
CDockAreaWidget * ads::CDockManager::addDockWidgetTabToArea | ( | CDockWidget * | Dockwidget, |
CDockAreaWidget * | DockAreaWidget | ||
) |
This function will add the given Dockwidget to the given DockAreaWidget as a new tab.
Definition at line 790 of file DockManager.cpp.
void ads::CDockManager::addPerspective | ( | const QString & | UniquePrespectiveName | ) |
Saves the current perspective to the internal list of perspectives. A perspective is the current state of the dock manager assigned with a certain name. This makes it possible for the user, to switch between different perspectives quickly. If a perspective with the given name already exists, then it will be overwritten with the new state.
Definition at line 821 of file DockManager.cpp.
QAction * ads::CDockManager::addToggleViewActionToMenu | ( | QAction * | ToggleViewAction, |
const QString & | Group = QString() , |
||
const QIcon & | GroupIcon = QIcon() |
||
) |
Adds a toggle view action to the the internal view menu. You can either manage the insertion of the toggle view actions in your application or you can add the actions to the internal view menu and then simply insert the menu object into your.
[in] | ToggleViewAction | The action to insert. If no group is provided the action is directly inserted into the menu. If a group is provided, the action is inserted into the group and the group is inserted into the menu if it is not existing yet. |
[in] | Group | This is the text used for the group menu item |
[in] | GroupIcon | The icon used for grouping the workbenches in the view menu. I.e. if there is a workbench for each device like for spectrometer devices, it is good to group all these workbenches under a menu item |
Definition at line 962 of file DockManager.cpp.
CDockWidget * ads::CDockManager::centralWidget | ( | ) | const |
This function returns managers central widget or nullptr if no central widget is set.
Definition at line 919 of file DockManager.cpp.
|
static |
This function returns the global configuration flags
Definition at line 1021 of file DockManager.cpp.
|
protected |
Overlay for containers
Definition at line 615 of file DockManager.cpp.
|
signal |
This signal is emitted, if a new DockArea has been created. An application can use this signal to set custom icons or custom tooltips for the DockArea buttons.
|
protected |
Overlay for dock areas
Definition at line 622 of file DockManager.cpp.
const QList< CDockContainerWidget * > ads::CDockManager::dockContainers | ( | ) | const |
Returns the list of all active and visible dock containers Dock containers are the main dock manager and all floating widgets
Definition at line 629 of file DockManager.cpp.
|
signal |
This signal is emitted just before the given dock widget is removed from the dock manager
|
signal |
This signal is emitted if a dock widget has been added to this dock manager instance.
|
signal |
This signal is emitted if a dock widget has been removed with the remove removeDockWidget() function. If this signal is emitted, the dock widget has been removed from the docking system but it is not deleted yet.
QMap< QString, CDockWidget * > ads::CDockManager::dockWidgetsMap | ( | ) | const |
This function returns a readable reference to the internal dock widgets map so that it is possible to iterate over all dock widgets
Definition at line 814 of file DockManager.cpp.
CDockWidget * ads::CDockManager::findDockWidget | ( | const QString & | ObjectName | ) | const |
Searches for a registered doc widget with the given ObjectName
Definition at line 798 of file DockManager.cpp.
|
signal |
This signal is emitted, if a new floating widget has been created. An application can use this signal to e.g. subscribe to events of the newly created window.
const QList< CFloatingDockContainer * > ads::CDockManager::floatingWidgets | ( | ) | const |
Returns the list of all floating widgets
Definition at line 636 of file DockManager.cpp.
CDockWidget * ads::CDockManager::focusedDockWidget | ( | ) | const |
Returns the dock widget that has focus style in the ui or a nullptr if not dock widget is painted focused. If the flag FocusHighlighting is disabled, this function always returns nullptr.
Definition at line 1086 of file DockManager.cpp.
|
signal |
This signal is emitted if the focused dock widget changed. Both old and now can be nullptr. The focused dock widget is the one that is highlighted in the GUI
|
static |
Returns the global icon provider. The icon provider enables the use of custom icons in case using styleheets for icons is not an option.
Definition at line 1048 of file DockManager.cpp.
bool ads::CDockManager::isRestoringState | ( | ) | const |
This function returns true between the restoringState() and stateRestored() signals.
Definition at line 1007 of file DockManager.cpp.
void ads::CDockManager::loadPerspectives | ( | QSettings & | Settings | ) |
Loads the perspectives from the given settings file
Definition at line 891 of file DockManager.cpp.
|
protected |
This function is called, if a floating widget has been dropped into an new position. When this function is called, all dock widgets of the FloatingWidget are already inserted into its new position
Definition at line 1066 of file DockManager.cpp.
|
protected |
A container needs to call this function if a widget has been dropped into it
Definition at line 1056 of file DockManager.cpp.
|
signal |
This signal is emitted, if the dock manager starts opening a perspective. Opening a perspective may take more than a second if there are many complex widgets. The application may use this signal to show some progress indicator or to change the mouse cursor into a busy cursor.
|
slot |
Opens the perspective with the given name.
Definition at line 860 of file DockManager.cpp.
|
signal |
This signal is emitted if the list of perspectives changed
QStringList ads::CDockManager::perspectiveNames | ( | ) | const |
Returns the names of all available perspectives
Definition at line 853 of file DockManager.cpp.
|
signal |
This signal is emitted if the dock manager finished opening a perspective.
|
signal |
This signal is emitted if perspectives have been removed
|
protected |
Registers the given dock container widget
Definition at line 598 of file DockManager.cpp.
|
protected |
Registers the given floating widget in the internal list of floating widgets
Definition at line 582 of file DockManager.cpp.
|
protected |
Remove dock container from the internal list of registered dock containers
Definition at line 605 of file DockManager.cpp.
void ads::CDockManager::removeDockWidget | ( | CDockWidget * | Dockwidget | ) |
Remove the given Dock from the dock manager
Definition at line 804 of file DockManager.cpp.
|
protected |
Remove the given floating widget from the list of registered floating widgets
Definition at line 591 of file DockManager.cpp.
void ads::CDockManager::removePerspective | ( | const QString & | Name | ) |
Removes the perspective with the given name from the list of perspectives
Definition at line 829 of file DockManager.cpp.
void ads::CDockManager::removePerspectives | ( | const QStringList & | Names | ) |
Removes the given perspectives from the dock manager
Definition at line 836 of file DockManager.cpp.
bool ads::CDockManager::restoreState | ( | const QByteArray & | state, |
int | version = 0 |
||
) |
Restores the state of this dockmanagers dockwidgets. The version number is compared with that stored in state. If they do not match, the dockmanager's state is left unchanged, and this function returns false; otherwise, the state is restored, and this function returns true.
Definition at line 679 of file DockManager.cpp.
|
signal |
This signal is emitted, if the restore function is called, just before the dock manager starts restoring the state. If this function is called, nothing has changed yet
void ads::CDockManager::savePerspectives | ( | QSettings & | Settings | ) | const |
Saves the perspectives to the given settings file.
Definition at line 875 of file DockManager.cpp.
QByteArray ads::CDockManager::saveState | ( | int | version = 0 | ) | const |
Saves the current state of the dockmanger and all its dock widgets into the returned QByteArray. The XmlMode enables / disables the auto formatting for the XmlStreamWriter. If auto formatting is enabled, the output is intended and line wrapped. The XmlMode XmlAutoFormattingDisabled is better if you would like to have a more compact XML output - i.e. for storage in ini files. The version number is stored as part of the data. To restore the saved state, pass the return value and version number to restoreState().
Definition at line 650 of file DockManager.cpp.
CDockAreaWidget * ads::CDockManager::setCentralWidget | ( | CDockWidget * | widget | ) |
Adds dockwidget widget into the central area and marks it as central widget. If central widget is set, it will be the only dock widget that will resize with the dock container. A central widget if not movable, floatable or closable and the titlebar of the central dock area is not visible. If the given widget could be set as central widget, the function returns the created dock area. If the widget could not be set, because there is already a central widget, this function returns a nullptr. To clear the central widget, pass a nullptr to the function.
!= | 0 The dock area that contains the central widget |
nullptr | Indicates that the given widget can not be set as central widget because there is already a central widget. |
Definition at line 926 of file DockManager.cpp.
|
static |
Set a certain config flag.
Definition at line 1035 of file DockManager.cpp.
|
static |
Sets the global configuration flags for the whole docking system. Call this function before you create the dock manager and before your create the first dock widget.
Definition at line 1028 of file DockManager.cpp.
|
slot |
Request a focus change to the given dock widget. This function only has an effect, if the flag CDockManager::FocusStyling is enabled
Definition at line 1076 of file DockManager.cpp.
void ads::CDockManager::setSplitterSizes | ( | CDockAreaWidget * | ContainedArea, |
const QList< int > & | sizes | ||
) |
Update the sizes of a splitter Programmatically updates the sizes of a given splitter by calling QSplitter::setSizes(). The splitter will be the splitter that contains the supplied dock area widget. If there is not splitter that contains the dock area, or the sizes supplied does not match the number of children of the splitter, this method will have no effect.
Definition at line 1113 of file DockManager.cpp.
void ads::CDockManager::setViewMenuInsertionOrder | ( | eViewMenuInsertionOrder | Order | ) |
Define the insertion order for toggle view menu items. The order defines how the actions are added to the view menu. The default insertion order is MenuAlphabeticallySorted to make it easier for users to find the menu entry for a certain dock widget. You need to call this function befor you insert the first menu item into the view menu.
Definition at line 1000 of file DockManager.cpp.
|
inlinestatic |
Helper function to set focus depending on the configuration of the FocusStyling flag
Definition at line 468 of file DockManager.h.
|
overrideprotectedvirtual |
Show the floating widgets that has been created floating
Definition at line 741 of file DockManager.cpp.
QList< int > ads::CDockManager::splitterSizes | ( | CDockAreaWidget * | ContainedArea | ) | const |
Returns the sizes of the splitter that contains the dock area.
If there is no splitter that contains the area, an empty list will be returned.
Definition at line 1099 of file DockManager.cpp.
|
static |
The distance the user needs to move the mouse with the left button hold down before a dock widget start floating
Definition at line 1014 of file DockManager.cpp.
|
signal |
This signal is emitted if the state changed in restoreState. The signal is emitted if the restoreState() function is called or if the openPerspective() function is called
|
static |
Returns true if the given config flag is set
Definition at line 1041 of file DockManager.cpp.
QMenu * ads::CDockManager::viewMenu | ( | ) | const |
This function returns the internal view menu. To fill the view menu, you can use the addToggleViewActionToMenu() function.
Definition at line 993 of file DockManager.cpp.
|
overridevirtual |
This function always return 0 because the main window is always behind any floating widget
Reimplemented from ads::CDockContainerWidget.
Definition at line 643 of file DockManager.cpp.
|
friend |
Definition at line 79 of file DockManager.h.
|
friend |
Definition at line 85 of file DockManager.h.
|
friend |
Definition at line 77 of file DockManager.h.
|
friend |
Definition at line 80 of file DockManager.h.
|
friend |
Definition at line 75 of file DockManager.h.
|
friend |
Definition at line 83 of file DockManager.h.
|
friend |
Definition at line 81 of file DockManager.h.
|
friend |
Definition at line 78 of file DockManager.h.
|
friend |
Definition at line 74 of file DockManager.h.
|
friend |
Definition at line 82 of file DockManager.h.
|
friend |
Definition at line 76 of file DockManager.h.
|
friend |
Definition at line 84 of file DockManager.h.
|
private |
private data (pimpl)
Definition at line 73 of file DockManager.h.