SplitButtonHandler
SplitButtonHandler
Handles adding split buttons to ADS dock area title bars. More…
#include <SplitButtonHandler.hpp>
Inherits from QObject
Public Types
| Name | |
|---|---|
| enum class | SplitDirection { Horizontal, Vertical} Split direction options. |
Public Signals
| Name | |
|---|---|
| void | splitRequested(ads::CDockAreaWidget * dock_area, SplitButtonHandler::SplitDirection direction) Emitted when user requests a split. |
| void | splitDockWidgetRequested(ads::CDockWidget * dock_widget, SplitButtonHandler::SplitDirection direction) Emitted when user requests to split a specific dock widget. |
Public Functions
| Name | |
|---|---|
| SplitButtonHandler(ads::CDockManager * dock_manager, QObject * parent =[nullptr]) Construct a SplitButtonHandler. |
|
| ~SplitButtonHandler() override | |
| void | setEnabled(bool enabled) Enable or disable split buttons globally. |
| bool | isEnabled() const Check if split buttons are enabled. |
| void | setDefaultSplitDirection(SplitDirection direction) Set the default split direction. |
| SplitDirection | defaultSplitDirection() const Get the default split direction. |
| void | setSplitIcon(QIcon const & icon) Set a custom icon for the split button. |
| QIcon | splitIcon() const Get the current split icon. |
| void | setTooltip(QString const & tooltip) Set tooltip text for the split button. |
Detailed Description
Handles adding split buttons to ADS dock area title bars.
This class monitors dock area creation and adds a split button to each title bar. When clicked, the split button emits a signal with the dock area and direction information.
Public Types Documentation
enum SplitDirection
| Enumerator | Value | Description |
|---|---|---|
| Horizontal | Split side-by-side (left/right). | |
| Vertical | Split above/below. |
Split direction options.
Public Signals Documentation
signal splitRequested
Emitted when user requests a split.
Parameters:
- dock_area The dock area where split was requested
- direction The split direction (horizontal or vertical)
The slot handling this signal should:
- Get the current dock widget from the dock area
- Create a duplicate/new widget for the split
- Add it to the appropriate side of the original
signal splitDockWidgetRequested
Emitted when user requests to split a specific dock widget.
Parameters:
- dock_widget The currently active dock widget in the area
- direction The split direction
This is an alternative signal that provides the current dock widget directly, which is often more convenient for implementation.
Public Functions Documentation
function SplitButtonHandler
Construct a SplitButtonHandler.
Parameters:
- dock_manager The ADS dock manager to monitor
- parent Parent QObject (typically MainWindow)
function ~SplitButtonHandler
function setEnabled
Enable or disable split buttons globally.
Parameters:
- enabled Whether split buttons should be shown
When disabled, existing buttons are hidden but not removed. When re-enabled, buttons become visible again.
function isEnabled
Check if split buttons are enabled.
function setDefaultSplitDirection
Set the default split direction.
Parameters:
- direction Default split direction
This direction is used when the split button is clicked without any modifier keys.
function defaultSplitDirection
Get the default split direction.
function setSplitIcon
Set a custom icon for the split button.
Parameters:
- icon Custom icon to use
If not set, a default split icon is used.
function splitIcon
Get the current split icon.
function setTooltip
Set tooltip text for the split button.
Parameters:
- tooltip Tooltip to display on hover
Updated on 2026-11-13 at 20:25:39 +0000