|
29 | 29 | - [`MiddleMouseButtonClosesTab`](#middlemousebuttonclosestab)
|
30 | 30 | - [`DisableTabTextEliding`](#disabletabtexteliding)
|
31 | 31 | - [`ShowTabTextOnlyForActiveTab`](#showtabtextonlyforactivetab)
|
32 |
| -- [Auto-Hide Configuration Flags](#auto-hide-configuration-flags) |
33 |
| - - [Auto Hide Dock Widgets](#auto-hide-dock-widgets) |
| 32 | + - [`DoubleClickUndocksWidget`](#doubleclickundockswidget) |
| 33 | +- [Auto Hide Dock Widgets](#auto-hide-dock-widgets) |
34 | 34 | - [Pinning Auto-Hide Widgets to a certain border](#pinning-auto-hide-widgets-to-a-certain-border)
|
35 | 35 | - [Show / Hide Auto-Hide Widgets via Mouse Over](#show--hide-auto-hide-widgets-via-mouse-over)
|
36 | 36 | - [Drag \& Drop to Auto-Hide](#drag--drop-to-auto-hide)
|
|
39 | 39 | - [Auto-Hide Drag to Float / Dock](#auto-hide-drag-to-float--dock)
|
40 | 40 | - [Auto-Hide Context Menu](#auto-hide-context-menu)
|
41 | 41 | - [Adding Auto Hide Widgets](#adding-auto-hide-widgets)
|
| 42 | +- [Auto-Hide Configuration Flags](#auto-hide-configuration-flags) |
42 | 43 | - [Setting Auto-Hide Flags](#setting-auto-hide-flags)
|
43 | 44 | - [`AutoHideFeatureEnabled`](#autohidefeatureenabled)
|
44 | 45 | - [`DockAreaHasAutoHideButton`](#dockareahasautohidebutton)
|
|
63 | 64 | - [Central Widget](#central-widget)
|
64 | 65 | - [Empty Dock Area](#empty-dock-area)
|
65 | 66 | - [Custom Close Handling](#custom-close-handling)
|
| 67 | +- [Globally Lock Docking Features](#globally-lock-docking-features) |
| 68 | +- [Dock Widget Size / Minimum Size Handling](#dock-widget-size--minimum-size-handling) |
66 | 69 | - [Styling](#styling)
|
67 | 70 | - [Disabling the Internal Style Sheet](#disabling-the-internal-style-sheet)
|
68 | 71 |
|
@@ -496,9 +499,12 @@ for active tabs. Inactive tabs only show their icon:
|
496 | 499 |
|
497 | 500 | 
|
498 | 501 |
|
499 |
| -## Auto-Hide Configuration Flags |
| 502 | +### `DoubleClickUndocksWidget` |
| 503 | +
|
| 504 | +If the flag is set (default), a double click on a tab undocks the dock widget. |
| 505 | +If you would like to disable undocking, just clear this flag. |
500 | 506 |
|
501 |
| -### Auto Hide Dock Widgets |
| 507 | +## Auto Hide Dock Widgets |
502 | 508 |
|
503 | 509 | The Advanced Docking System supports "Auto-Hide" functionality for **all**
|
504 | 510 | dock containers. The "Auto Hide" feature allows to display more information
|
@@ -599,6 +605,8 @@ DockManager->addAutoHideDockWidget(SideBarLeft, TableDockWidget);
|
599 | 605 |
|
600 | 606 | See `autohide` example or the demo application to learn how it works.
|
601 | 607 |
|
| 608 | +## Auto-Hide Configuration Flags |
| 609 | + |
602 | 610 | ### Setting Auto-Hide Flags
|
603 | 611 |
|
604 | 612 | The Advanced Docking System has a number of global configuration flags to
|
@@ -835,6 +843,93 @@ Normally clicking the close button of a dock widget will just hide the widget an
|
835 | 843 |
|
836 | 844 | When an entire area is closed, the default behavior is to hide the dock widgets it contains regardless of the `DockWidgetDeleteOnClose` flag except if there is only one dock widget. In this special case, the `DockWidgetDeleteOnClose` flag is followed. This behavior can be changed by setting the `DockWidgetForceCloseWithArea` flag to all the dock widgets that needs to be closed with their area.
|
837 | 845 |
|
| 846 | +## Globally Lock Docking Features |
| 847 | +
|
| 848 | +It is possible to globally lock features of all dock widgets to "freeze" the |
| 849 | +current workspace layout. That means, you can now lock your workspace |
| 850 | +to avoid accidentally dragging a docked view. When locking was't possible, |
| 851 | +users had to manually dock it back to the desired place after each accidental |
| 852 | +undock. |
| 853 | +
|
| 854 | +You can use a combination of the following feature flags to define which features |
| 855 | +shall get locked: |
| 856 | +
|
| 857 | +- CDockWidget::DockWidgetClosable |
| 858 | +- CDockWidget::DockWidgetMovable |
| 859 | +- CDockWidget::DockWidgetFloatable |
| 860 | +- CDockWidget::DockWidgetPinable |
| 861 | +
|
| 862 | +To clear the locked features, you can use CDockWidget::NoDockWidgetFeatures |
| 863 | +The following code shows how to lock and unlock all dock widget features |
| 864 | +globally. |
| 865 | +
|
| 866 | +```c++ |
| 867 | +DockManager->lockDockWidgetFeaturesGlobally(); |
| 868 | +DockManager->lockDockWidgetFeaturesGlobally(CDockWidget::NoDockWidgetFeatures); |
| 869 | +``` |
| 870 | + |
| 871 | +## Dock Widget Size / Minimum Size Handling |
| 872 | + |
| 873 | +There are several `CDockWidget` mode enums to control how a `CDockWidget` is |
| 874 | +resized and how the docking system handles the minimum size of a dockwidget. |
| 875 | + |
| 876 | +The first one is the `eInsertMode` enum: |
| 877 | + |
| 878 | +```c++ |
| 879 | +enum eInsertMode |
| 880 | +{ |
| 881 | + AutoScrollArea, |
| 882 | + ForceScrollArea, |
| 883 | + ForceNoScrollArea |
| 884 | +}; |
| 885 | +``` |
| 886 | + |
| 887 | +The InsertMode defines how the widget is inserted into the dock widget, when you |
| 888 | +call the `CDockWidget::setWidget` method: |
| 889 | + |
| 890 | +```c++ |
| 891 | +DockWidget->setWidget(widget, CDockWidget::AutoScrollArea); |
| 892 | +``` |
| 893 | +
|
| 894 | +The content of a dock widget should be resizable do a very small size to |
| 895 | +prevent the dock widget from blocking the resizing. To ensure, that a |
| 896 | +dock widget can be resized very well, it is better to insert the content |
| 897 | +widget into a scroll area or to provide a widget that is already a scroll |
| 898 | +area or that contains a scroll area (such as an `QAbstractItemView`) |
| 899 | +If the InsertMode is `AutoScrollArea`, the DockWidget tries to automatically |
| 900 | +detect how to insert the given widget. If the widget is derived from |
| 901 | +`QScrollArea` (i.e. an `QAbstractItemView`), then the widget is inserted |
| 902 | +directly. If the given widget is not a scroll area, the widget will be |
| 903 | +inserted into a scroll area. |
| 904 | +
|
| 905 | +To force insertion into a scroll area, you can also provide the InsertMode |
| 906 | +`ForceScrollArea`. In this case a scroll area will also be created for content |
| 907 | +widgets that are derived from `QScrollArea` To prevent insertion into a scroll |
| 908 | +area, you can provide the InsertMode `ForceNoScrollArea`. In this case, the |
| 909 | +content widget is always inserted directly. |
| 910 | +
|
| 911 | +A second enum, the `eMinimumSizeHintMode` defines, which value will be returned |
| 912 | +from the `CDockWidget::minimumSizeHint()` function: |
| 913 | +
|
| 914 | +```c++ |
| 915 | +enum eMinimumSizeHintMode |
| 916 | +{ |
| 917 | + MinimumSizeHintFromDockWidget, |
| 918 | + MinimumSizeHintFromContent, |
| 919 | + MinimumSizeHintFromDockWidgetMinimumSize, |
| 920 | + MinimumSizeHintFromContentMinimumSize, |
| 921 | +}; |
| 922 | +``` |
| 923 | + |
| 924 | +To ensure, that a dock widget does not block resizing, the dock widget |
| 925 | +reimplements `minimumSizeHint()` function to return a very small minimum |
| 926 | +size hint. If you would like to adhere the `minimumSizeHint()` from the |
| 927 | +content widget, then set the `minimumSizeHintMode()` to |
| 928 | +`MinimumSizeHintFromContent`. If you would like to use the `minimumSize()` |
| 929 | +value of the content widget or the dock widget, then you can use the |
| 930 | +`MinimumSizeHintFromDockWidgetMinimumSize` or |
| 931 | +`MinimumSizeHintFromContentMinimumSize` modes. |
| 932 | + |
838 | 933 | ## Styling
|
839 | 934 |
|
840 | 935 | The Advanced Docking System supports styling via [Qt Style Sheets](https://doc.qt.io/qt-5/stylesheet.html). All components like splitters, tabs, buttons, titlebar and
|
|
0 commit comments