![]() |
NDEVR
API Documentation
|
Provides a way to optionally lazily initialize widgets when needed but still pass them to container docks. More...
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 QCustomDockWidget * | getDock () |
| 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. | |
| QCustomDockWidget * | m_dock_item = nullptr |
| The cached dock widget pointer. | |
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.
|
inline |
Constructs a DockInit with a lazy-initialization function.
| [in] | init | The function that creates the dock widget on first access. |
Definition at line 47 of file WidgetInit.h.
References m_create_dock.
|
inline |
Constructs a DockInit with an already-created dock widget.
| [in] | init | The pre-existing dock widget. |
Definition at line 52 of file WidgetInit.h.
References m_dock_item.
|
inlinevirtual |
Returns the dock widget, creating it lazily if it has not been initialized yet.
Definition at line 63 of file WidgetInit.h.
References m_create_dock, and m_dock_item.
|
inline |
Returns whether the dock widget has been initialized.
Definition at line 57 of file WidgetInit.h.
References m_dock_item.