NDEVR
API Documentation
DockInit

Provides a way to optionally lazily initialize widgets when needed but still pass them to container docks. More...

Collaboration diagram for DockInit:
[legend]

Public Member Functions

 DockInit (QCustomDockWidget *init)
 Constructs a DockInit with an already-created dock widget.
 DockInit (std::function< QCustomDockWidget *()> init)
 Constructs a DockInit with a lazy-initialization function.
virtual QCustomDockWidgetgetDock ()
 Returns the dock widget, creating it lazily if it has not been initialized yet.
bool isInit () const
 Returns whether the dock widget has been initialized.

Protected Attributes

const std::function< QCustomDockWidget *()> m_create_dock
 The factory function for lazy dock creation.
QCustomDockWidgetm_dock_item = nullptr
 The cached dock widget pointer.

Detailed Description

Provides a way to optionally lazily initialize widgets when needed but still pass them to container docks.


Useful for adding things to Settings dialogs or other large structures where they may never be initialized.

Definition at line 42 of file WidgetInit.h.

Constructor & Destructor Documentation

◆ DockInit() [1/2]

DockInit::DockInit ( std::function< QCustomDockWidget *()> init)
inline

Constructs a DockInit with a lazy-initialization function.

Parameters
[in]initThe function that creates the dock widget on first access.

Definition at line 47 of file WidgetInit.h.

References m_create_dock.

◆ DockInit() [2/2]

DockInit::DockInit ( QCustomDockWidget * init)
inline

Constructs a DockInit with an already-created dock widget.

Parameters
[in]initThe pre-existing dock widget.

Definition at line 52 of file WidgetInit.h.

References m_dock_item.

Member Function Documentation

◆ getDock()

virtual QCustomDockWidget * DockInit::getDock ( )
inlinevirtual

Returns the dock widget, creating it lazily if it has not been initialized yet.

Returns
The managed QCustomDockWidget pointer.

Definition at line 63 of file WidgetInit.h.

References m_create_dock, and m_dock_item.

◆ isInit()

bool DockInit::isInit ( ) const
inline

Returns whether the dock widget has been initialized.

Returns
True if the dock widget has been created.

Definition at line 57 of file WidgetInit.h.

References m_dock_item.


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