NDEVR
API Documentation
QCustomDockWidget

Provides a wrapper for a widget that can be docked inside a Container or floated as a top-level window within the application. More...

Inheritance diagram for QCustomDockWidget:
[legend]
Collaboration diagram for QCustomDockWidget:
[legend]

Public Member Functions

 QCustomDockWidget (QWidget *main_widget, ContainerWidgetBase *container=nullptr)
 Constructs a dock widget wrapping a main widget with an optional container.
 QCustomDockWidget (QWidget *main_widget, RibbonArea ribbon_area, ContainerWidgetBase *container=nullptr)
 Constructs a dock widget wrapping a main widget with a specified ribbon area.
 QCustomDockWidget (RibbonArea ribbon_area, ContainerWidgetBase *container=nullptr)
 Constructs a dock widget with a specified ribbon area and optional container.
virtual ~QCustomDockWidget ()
 Destroys the dock widget and cleans up associated resources.
void closedSignal ()
 Emitted when the dock widget is closed.
SectionContentcontent () const
 Returns the SectionContent associated with this dock widget.
void dockSelectedSignal (bool)
 Emitted when the dock widget selection state changes.
void fullscreenSignal (bool is_fullscreen)
 Emitted when the dock widget enters or exits fullscreen mode.
int height () const
 Returns the current height of the dock widget.
void highlightDock (bool highlight)
 Highlights or un-highlights the dock widget visually.
QIcon icon () const
 Returns the icon displayed in the dock title bar.
bool isDockFullscreen () const
 Returns whether the dock is currently displayed in fullscreen mode.
bool isVisible () const
 Returns whether the dock widget is currently visible to the user.
QWidget * mainWidget ()
 Returns the main widget displayed inside the dock.
void minimizedSignal ()
 Emitted when the dock widget is minimized.
virtual void removeButton (Button *button)
 Removes a previously registered button from this dock widget.
void removeDock (bool delete_when_finished)
 Removes the dock from its container.
void setAllowAutoHideTitle (bool allow_auto_hide)
 Sets whether the title bar can be automatically hidden when not needed.
virtual void setDockSelected (bool selected) override
 Sets the selected state of the dock, updating visual indicators.
virtual void setIcon (const QIcon &icon) override
 Sets the icon displayed in the dock title bar.
void setIconSlot (const QIcon &icon)
 Slot to set the dock icon from a QIcon.
void setMainWidget (QWidget *widget)
 Sets the main widget displayed inside the dock.
void setSize (QSize size)
 Sets the preferred size of the dock widget.
void setSizeHint (const QSize &size)
 Sets the preferred size hint for the dock widget.
virtual void setTitle (const TranslatedString &title) override
 Sets the title text displayed in the dock title bar.
void setTitleSlot (const QString &title)
 Slot to set the dock title from a QString.
void setupButton (Button *button)
 Configures a button to toggle the visibility of this dock widget.
virtual void setupDialogButton (Button *button)
 Sets up a button as a dialog toggle button for this dock widget.
void setVisible (bool visible)
 Sets the visibility of the dock widget.
void setWindowFlag (Qt::WindowType type, bool on=true)
 Sets or clears a specific window flag.
void setWindowFlags (Qt::WindowFlags type)
 Sets the window flags for the dock widget when floating.
void showDock (bool show_dock)
 Shows or hides the dock widget.
void showDock (bool show_dock, const PopupInfo &start_location, const PopupInfo &end_location, SectionWidget *section=nullptr)
 Shows or hides the dock with start and end animation locations.
void showDock (bool show_dock, const PopupInfo &start_location, SectionWidget *section=nullptr)
 Shows or hides the dock with a popup start location.
void showDock (bool show_dock, DropArea area, SectionWidget *section)
 Shows or hides the dock in a specific drop area within a section.
void showDockFullscreen (bool show_dock, const PopupInfo &start_location=PopupInfo())
 Shows or hides the dock in fullscreen mode.
QSize sizeHint () const
 Returns the recommended size for the dock widget.
int width () const
 Returns the current width of the dock widget.
void windowIconChanged (const QIcon &icon)
 Emitted when the window icon changes.
QString windowTitle () const
 Returns the window title of the dock widget.
void windowTitleChanged (const TranslatedString &new_title)
 Emitted when the window title changes.
Public Member Functions inherited from DockItem
 DockItem (ContainerWidgetBase *container=nullptr)
 Constructs a DockItem with an optional container.
 DockItem (RibbonArea ribbon_area, ContainerWidgetBase *container=nullptr)
 Constructs a DockItem with a preferred ribbon area and optional container.
ContainerWidgetBasecontainer () const
 Returns the container widget that owns this dock item.
FloatingWidgetfloatingWidget () const
 Returns the floating widget if this dock item is currently floating.
bool isClosable () const
 Checks whether this dock item can be closed by the user.
bool isDocked () const
 Checks whether this dock item is currently docked in a section.
bool isDockSelected () const
 Checks whether this dock item is currently selected.
bool isDockVisible () const
 Checks whether this dock item is currently visible in its dock.
bool isHidable () const
 Checks whether this dock item can be hidden by the user.
bool isMovable () const
 Checks whether this dock item can be moved by the user.
bool isWindowable () const
 Checks whether this dock item can be detached into a floating window.
void moveTabToEnd ()
 Moves this dock item's tab to the end of the tab bar.
void moveTabToStart ()
 Moves this dock item's tab to the start of the tab bar.
SectionWidgetsection () const
 Returns the section widget that currently contains this dock item.
void setClosable (bool closable)
 Sets whether this dock item can be closed by the user.
virtual void setContainer (ContainerWidgetBase *container)
 Sets the container widget that owns this dock item.
void setDockArea (DropArea drop_area, SectionWidget *section)
 Sets the drop area and target section for docking this item.
void setHidable (bool hidable)
 Sets whether this dock item can be hidden by the user.
virtual void setIconID (const StringView &icon)
 Sets the icon by resource identifier string.
void setMoveable (bool movable)
 Sets whether this dock item can be moved by the user.
void setRibbonArea (RibbonArea ribbon_area)
 Sets the preferred ribbon area for this dock item.
void setSettingsCallback (const std::function< void(PopupInfo)> &callback)
 Sets the callback invoked when the settings action is triggered.
void setShowTab (bool show_tab)
 Sets whether the tab for this dock item is shown.
void setTabFlat (bool flat)
 Sets whether the tab for this dock item should have a flat appearance.
std::function< void(PopupInfo)> settingsCallback ()
 Returns the callback invoked when the settings action is triggered.
virtual void setUseTabTitle (bool use_tab_title)
 Sets whether the tab title should be used for display.
void setWindowable (bool hidable)
 Sets whether this dock item can be detached into a floating window.
bool showTab () const
 Checks whether the tab for this dock item is shown.
virtual void swapWith (DockItem *other_widget)
 Swaps this dock item's position and section with another dock item.
virtual const TranslatedStringtitle () const
 Returns the display title of this dock item.
SectionIconTabtitleWidget () const
 Returns the icon/title tab widget associated with this dock item.
bool useTabTitle () const
 Checks whether the tab title is used for display.

Protected Member Functions

virtual void createSectionContent () override
 Creates the SectionContent that represents this dock in the container system.
void onCloseButtonClicked ()
 Slot invoked when the close button is clicked.
void onFullscreenButtonClicked (bool fullscreen)
 Slot invoked when the fullscreen button is clicked.
Protected Member Functions inherited from DockItem
virtual void initialize ()
 Initializes the dock item after construction, setting up internal state.

Protected Attributes

Buffer< Button * > m_buttons_to_add
 Buttons queued to be added to the dock title bar.
bool m_highlight_dock
 Whether the dock is currently highlighted.
QPointer< QWidget > m_main_widget
 The main widget displayed inside the dock.
QSize m_size_hint
 The preferred size hint for the dock widget.
Protected Attributes inherited from DockItem
QPointer< ContainerWidgetBasem_container
 The container widget that owns this dock item.
QIcon m_icon
 The QIcon displayed on this dock item's tab.
String m_icon_id
 The icon resource identifier string.
SectionIconTabm_icon_title
 The icon/title tab widget for this dock item.
bool m_is_closable
 Whether the user can close this dock item.
bool m_is_hidable
 Whether the user can hide this dock item.
bool m_is_movable
 Whether the user can move this dock item.
bool m_is_selected
 Whether this dock item is currently selected.
bool m_is_windowable
 Whether the user can detach this item into a floating window.
SectionWidgetm_original_section
 The section widget this item was originally docked in.
RibbonArea m_preferred_ribbon_area
 The preferred ribbon area for this dock item.
SectionContentm_section_content
 The section content representing this dock item.
std::function< void(PopupInfo)> m_settings_callback
 Callback invoked when the settings action is triggered.
bool m_show_tab
 Whether the tab for this dock item is shown.
TranslatedString m_title
 The translated display title.
bool m_use_tab_title
 Whether the tab title is used for display.
UUID m_uuid
 The unique identifier for this dock item.

Detailed Description

Provides a wrapper for a widget that can be docked inside a Container or floated as a top-level window within the application.


Definition at line 61 of file QCustomDockWidget.h.

Constructor & Destructor Documentation

◆ QCustomDockWidget() [1/3]

QCustomDockWidget::QCustomDockWidget ( RibbonArea ribbon_area,
ContainerWidgetBase * container = nullptr )
explicit

Constructs a dock widget with a specified ribbon area and optional container.

Parameters
[in]ribbon_areaThe ribbon area where this dock should appear.
[in]containerThe parent container widget.

References DockItem::container().

Referenced by DockWidget< t_type >::DockWidget(), DockWidget< t_type >::DockWidget(), and DockWidget< t_type >::DockWidget().

◆ QCustomDockWidget() [2/3]

QCustomDockWidget::QCustomDockWidget ( QWidget * main_widget,
RibbonArea ribbon_area,
ContainerWidgetBase * container = nullptr )
explicit

Constructs a dock widget wrapping a main widget with a specified ribbon area.

Parameters
[in]main_widgetThe widget to wrap inside the dock.
[in]ribbon_areaThe ribbon area where this dock should appear.
[in]containerThe parent container widget.

References DockItem::container().

◆ QCustomDockWidget() [3/3]

QCustomDockWidget::QCustomDockWidget ( QWidget * main_widget,
ContainerWidgetBase * container = nullptr )
explicit

Constructs a dock widget wrapping a main widget with an optional container.

Parameters
[in]main_widgetThe widget to wrap inside the dock.
[in]containerThe parent container widget.

References DockItem::container().

Member Function Documentation

◆ content()

SectionContent * QCustomDockWidget::content ( ) const
inline

Returns the SectionContent associated with this dock widget.

Returns
A pointer to the SectionContent.

Definition at line 112 of file QCustomDockWidget.h.

References DockItem::m_section_content.

◆ dockSelectedSignal()

void QCustomDockWidget::dockSelectedSignal ( bool )

Emitted when the dock widget selection state changes.

Parameters
[in]selectedWhether the dock is now selected.

◆ fullscreenSignal()

void QCustomDockWidget::fullscreenSignal ( bool is_fullscreen)

Emitted when the dock widget enters or exits fullscreen mode.

Parameters
[in]is_fullscreenWhether the dock is now fullscreen.

◆ height()

int QCustomDockWidget::height ( ) const

Returns the current height of the dock widget.

Returns
The height in pixels.

◆ highlightDock()

void QCustomDockWidget::highlightDock ( bool highlight)

Highlights or un-highlights the dock widget visually.

Parameters
[in]highlightWhether to highlight the dock.

◆ icon()

QIcon QCustomDockWidget::icon ( ) const

Returns the icon displayed in the dock title bar.

Returns
The current dock icon.

Referenced by setIcon(), setIconSlot(), and windowIconChanged().

◆ isDockFullscreen()

bool QCustomDockWidget::isDockFullscreen ( ) const

Returns whether the dock is currently displayed in fullscreen mode.

Returns
True if fullscreen, false otherwise.

◆ isVisible()

bool QCustomDockWidget::isVisible ( ) const

Returns whether the dock widget is currently visible to the user.

Returns
True if visible, false otherwise.

◆ mainWidget()

QWidget * QCustomDockWidget::mainWidget ( )
inline

Returns the main widget displayed inside the dock.

Returns
A pointer to the main widget.

Definition at line 97 of file QCustomDockWidget.h.

References m_main_widget.

◆ onFullscreenButtonClicked()

void QCustomDockWidget::onFullscreenButtonClicked ( bool fullscreen)
protected

Slot invoked when the fullscreen button is clicked.

Parameters
[in]fullscreenWhether to enter or exit fullscreen.

◆ removeButton()

virtual void QCustomDockWidget::removeButton ( Button * button)
virtual

Removes a previously registered button from this dock widget.

Parameters
[in]buttonThe button to remove.

◆ removeDock()

void QCustomDockWidget::removeDock ( bool delete_when_finished)

Removes the dock from its container.

Parameters
[in]delete_when_finishedWhether to delete the dock widget after removal.

◆ setAllowAutoHideTitle()

void QCustomDockWidget::setAllowAutoHideTitle ( bool allow_auto_hide)

Sets whether the title bar can be automatically hidden when not needed.

Parameters
[in]allow_auto_hideWhether to allow automatic title hiding.

◆ setDockSelected()

virtual void QCustomDockWidget::setDockSelected ( bool selected)
overridevirtual

Sets the selected state of the dock, updating visual indicators.

Parameters
[in]selectedWhether the dock is selected.

Reimplemented from DockItem.

◆ setIcon()

virtual void QCustomDockWidget::setIcon ( const QIcon & icon)
overridevirtual

Sets the icon displayed in the dock title bar.

Parameters
[in]iconThe icon to display.

Reimplemented from DockItem.

References icon().

◆ setIconSlot()

void QCustomDockWidget::setIconSlot ( const QIcon & icon)

Slot to set the dock icon from a QIcon.

Parameters
[in]iconThe icon to set.

References icon().

◆ setMainWidget()

void QCustomDockWidget::setMainWidget ( QWidget * widget)

Sets the main widget displayed inside the dock.

Parameters
[in]widgetThe widget to display.

◆ setSize()

void QCustomDockWidget::setSize ( QSize size)

Sets the preferred size of the dock widget.

Parameters
[in]sizeThe size to set.

◆ setSizeHint()

void QCustomDockWidget::setSizeHint ( const QSize & size)

Sets the preferred size hint for the dock widget.

Parameters
[in]sizeThe size hint to set.

◆ setTitle()

virtual void QCustomDockWidget::setTitle ( const TranslatedString & title)
overridevirtual

Sets the title text displayed in the dock title bar.

Parameters
[in]titleThe title to display.

Reimplemented from DockItem.

References DockItem::title().

◆ setTitleSlot()

void QCustomDockWidget::setTitleSlot ( const QString & title)

Slot to set the dock title from a QString.

Parameters
[in]titleThe title to set.

References DockItem::title().

◆ setupButton()

void QCustomDockWidget::setupButton ( Button * button)

Configures a button to toggle the visibility of this dock widget.

Parameters
[in]buttonThe button to set up.

◆ setupDialogButton()

virtual void QCustomDockWidget::setupDialogButton ( Button * button)
virtual

Sets up a button as a dialog toggle button for this dock widget.

Parameters
[in]buttonThe button to configure.

◆ setVisible()

void QCustomDockWidget::setVisible ( bool visible)

Sets the visibility of the dock widget.

Parameters
[in]visibleWhether the dock should be visible.

◆ setWindowFlag()

void QCustomDockWidget::setWindowFlag ( Qt::WindowType type,
bool on = true )

Sets or clears a specific window flag.

Parameters
[in]typeThe window flag to modify.
[in]onWhether to enable or disable the flag.

◆ setWindowFlags()

void QCustomDockWidget::setWindowFlags ( Qt::WindowFlags type)

Sets the window flags for the dock widget when floating.

Parameters
[in]typeThe window flags to set.

◆ showDock() [1/4]

void QCustomDockWidget::showDock ( bool show_dock)

Shows or hides the dock widget.

Parameters
[in]show_dockWhether to show the dock.

◆ showDock() [2/4]

void QCustomDockWidget::showDock ( bool show_dock,
const PopupInfo & start_location,
const PopupInfo & end_location,
SectionWidget * section = nullptr )

Shows or hides the dock with start and end animation locations.

Parameters
[in]show_dockWhether to show the dock.
[in]start_locationThe popup animation start location.
[in]end_locationThe popup animation end location.
[in]sectionThe target section widget.

References DockItem::section().

◆ showDock() [3/4]

void QCustomDockWidget::showDock ( bool show_dock,
const PopupInfo & start_location,
SectionWidget * section = nullptr )

Shows or hides the dock with a popup start location.

Parameters
[in]show_dockWhether to show the dock.
[in]start_locationThe popup animation start location.
[in]sectionThe target section widget.

References DockItem::section().

◆ showDock() [4/4]

void QCustomDockWidget::showDock ( bool show_dock,
DropArea area,
SectionWidget * section )

Shows or hides the dock in a specific drop area within a section.

Parameters
[in]show_dockWhether to show the dock.
[in]areaThe drop area where the dock should be placed.
[in]sectionThe target section widget.

References DockItem::section().

◆ showDockFullscreen()

void QCustomDockWidget::showDockFullscreen ( bool show_dock,
const PopupInfo & start_location = PopupInfo() )

Shows or hides the dock in fullscreen mode.

Parameters
[in]show_dockWhether to show the dock.
[in]start_locationThe popup animation start location.

◆ sizeHint()

QSize QCustomDockWidget::sizeHint ( ) const

Returns the recommended size for the dock widget.

Returns
The size hint.

◆ width()

int QCustomDockWidget::width ( ) const

Returns the current width of the dock widget.

Returns
The width in pixels.

◆ windowIconChanged()

void QCustomDockWidget::windowIconChanged ( const QIcon & icon)

Emitted when the window icon changes.

Parameters
[in]iconThe new icon.

References icon().

◆ windowTitle()

QString QCustomDockWidget::windowTitle ( ) const

Returns the window title of the dock widget.

Returns
The window title as a QString.

◆ windowTitleChanged()

void QCustomDockWidget::windowTitleChanged ( const TranslatedString & new_title)

Emitted when the window title changes.

Parameters
[in]new_titleThe new title text.

The documentation for this class was generated from the following file: