NDEVR
API Documentation

The root class that allows interface with the NDEVR API Widget Docking system. More...

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

Public Member Functions

 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.
virtual void setDockSelected (bool selected)
 Sets whether this dock item is visually selected.
void setHidable (bool hidable)
 Sets whether this dock item can be hidden by the user.
virtual void setIcon (const QIcon &icon)
 Sets the icon displayed on this dock item's tab.
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 setTitle (const TranslatedString &title)
 Sets the display title for this dock item.
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 ()
 Creates the SectionContent used to represent this dock item in the docking system.
virtual void initialize ()
 Initializes the dock item after construction, setting up internal state.

Protected Attributes

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

The root class that allows interface with the NDEVR API Widget Docking system.


Definition at line 55 of file DockItem.h.

Constructor & Destructor Documentation

◆ DockItem() [1/2]

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

Constructs a DockItem with a preferred ribbon area and optional container.

Parameters
[in]ribbon_areaThe preferred ribbon area for this dock item.
[in]containerThe parent container widget, or nullptr.

References container().

Referenced by DockItem(), and swapWith().

◆ DockItem() [2/2]

DockItem::DockItem ( ContainerWidgetBase * container = nullptr)
explicit

Constructs a DockItem with an optional container.

Parameters
[in]containerThe parent container widget, or nullptr.

References DockItem(), and container().

Member Function Documentation

◆ container()

◆ floatingWidget()

FloatingWidget * DockItem::floatingWidget ( ) const

Returns the floating widget if this dock item is currently floating.

Returns
A pointer to the FloatingWidget, or nullptr if not floating.

◆ isClosable()

bool DockItem::isClosable ( ) const
inline

Checks whether this dock item can be closed by the user.

Returns
True if the item is closable.

Definition at line 164 of file DockItem.h.

References m_is_closable.

◆ isDocked()

bool DockItem::isDocked ( ) const

Checks whether this dock item is currently docked in a section.

Returns
True if the item is docked.

◆ isDockSelected()

bool DockItem::isDockSelected ( ) const
inline

Checks whether this dock item is currently selected.

Returns
True if the item is selected.

Definition at line 214 of file DockItem.h.

References m_is_selected.

◆ isDockVisible()

bool DockItem::isDockVisible ( ) const

Checks whether this dock item is currently visible in its dock.

Returns
True if the item is visible.

◆ isHidable()

bool DockItem::isHidable ( ) const
inline

Checks whether this dock item can be hidden by the user.

Returns
True if the item is hidable.

Definition at line 169 of file DockItem.h.

References m_is_hidable.

◆ isMovable()

bool DockItem::isMovable ( ) const

Checks whether this dock item can be moved by the user.

Returns
True if the item is movable.

◆ isWindowable()

bool DockItem::isWindowable ( ) const
inline

Checks whether this dock item can be detached into a floating window.

Returns
True if the item is windowable.

Definition at line 174 of file DockItem.h.

References m_is_windowable.

◆ section()

SectionWidget * DockItem::section ( ) const

Returns the section widget that currently contains this dock item.

Returns
A pointer to the SectionWidget.

Referenced by setDockArea(), CustomDockButton::showButton(), QCustomDockWidget::showDock(), QCustomDockWidget::showDock(), and QCustomDockWidget::showDock().

◆ setClosable()

void DockItem::setClosable ( bool closable)

Sets whether this dock item can be closed by the user.

Parameters
[in]closableWhether the item is closable.

◆ setContainer()

virtual void DockItem::setContainer ( ContainerWidgetBase * container)
virtual

Sets the container widget that owns this dock item.

Parameters
[in]containerThe container widget to assign.

References container().

◆ setDockArea()

void DockItem::setDockArea ( DropArea drop_area,
SectionWidget * section )

Sets the drop area and target section for docking this item.

Parameters
[in]drop_areaThe drop area within the section widget.
[in]sectionThe target section widget.

References section().

◆ setDockSelected()

virtual void DockItem::setDockSelected ( bool selected)
virtual

Sets whether this dock item is visually selected.

Parameters
[in]selectedWhether the item is selected.

Reimplemented in QCustomDockWidget.

◆ setHidable()

void DockItem::setHidable ( bool hidable)

Sets whether this dock item can be hidden by the user.

Parameters
[in]hidableWhether the item is hidable.

◆ setIcon()

virtual void DockItem::setIcon ( const QIcon & icon)
virtual

Sets the icon displayed on this dock item's tab.

Parameters
[in]iconThe QIcon to display.

Reimplemented in QCustomDockWidget.

◆ setIconID()

virtual void DockItem::setIconID ( const StringView & icon)
virtual

Sets the icon by resource identifier string.

Parameters
[in]iconThe icon resource identifier.

◆ setMoveable()

void DockItem::setMoveable ( bool movable)

Sets whether this dock item can be moved by the user.

Parameters
[in]movableWhether the item is movable.

◆ setRibbonArea()

void DockItem::setRibbonArea ( RibbonArea ribbon_area)

Sets the preferred ribbon area for this dock item.

Parameters
[in]ribbon_areaThe ribbon area to assign.

◆ setSettingsCallback()

void DockItem::setSettingsCallback ( const std::function< void(PopupInfo)> & callback)
inline

Sets the callback invoked when the settings action is triggered.

Parameters
[in]callbackThe settings callback function.

Definition at line 179 of file DockItem.h.

References m_settings_callback.

◆ setShowTab()

void DockItem::setShowTab ( bool show_tab)

Sets whether the tab for this dock item is shown.

Parameters
[in]show_tabWhether to show the tab.

◆ setTabFlat()

void DockItem::setTabFlat ( bool flat)

Sets whether the tab for this dock item should have a flat appearance.

Parameters
[in]flatWhether the tab should be flat.

◆ settingsCallback()

std::function< void(PopupInfo)> DockItem::settingsCallback ( )
inline

Returns the callback invoked when the settings action is triggered.

Returns
The settings callback function.

Definition at line 184 of file DockItem.h.

References m_settings_callback.

◆ setTitle()

virtual void DockItem::setTitle ( const TranslatedString & title)
virtual

Sets the display title for this dock item.

Parameters
[in]titleThe translated title string.

Reimplemented in QCustomDockWidget.

References title().

◆ setUseTabTitle()

virtual void DockItem::setUseTabTitle ( bool use_tab_title)
virtual

Sets whether the tab title should be used for display.

Parameters
[in]use_tab_titleWhether to use the tab title.

◆ setWindowable()

void DockItem::setWindowable ( bool hidable)

Sets whether this dock item can be detached into a floating window.

Parameters
[in]hidableWhether the item is windowable.

◆ showTab()

bool DockItem::showTab ( ) const

Checks whether the tab for this dock item is shown.

Returns
True if the tab is shown.

◆ swapWith()

virtual void DockItem::swapWith ( DockItem * other_widget)
virtual

Swaps this dock item's position and section with another dock item.

Parameters
[in]other_widgetThe dock item to swap with.

References DockItem().

◆ title()

virtual const TranslatedString & DockItem::title ( ) const
inlinevirtual

Returns the display title of this dock item.

Returns
A const reference to the translated title string.

Definition at line 234 of file DockItem.h.

References m_title.

Referenced by setTitle(), QCustomDockWidget::setTitle(), and QCustomDockWidget::setTitleSlot().

◆ titleWidget()

SectionIconTab * DockItem::titleWidget ( ) const

Returns the icon/title tab widget associated with this dock item.

Returns
A pointer to the SectionIconTab.

◆ useTabTitle()

bool DockItem::useTabTitle ( ) const

Checks whether the tab title is used for display.

Returns
True if the tab title is used.

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