BlendSplitter  3.0.0
A Blender-like Qt Widget management library
RegistryItem Class Reference

An item intended to be put into WidgetRegistry. More...

#include <RegistryItem.hpp>

Collaboration diagram for RegistryItem:

Public Member Functions

 RegistryItem (QString name="Default", QWidget *(*widget)()=[]() ->QWidget *{return new QLabel{"Default Widget"};}, void(*populateBar)(SwitchingBar *, QWidget *)=[](SwitchingBar *, QWidget *) ->void {})
 A constructor setting all the internal values. More...
 

Public Attributes

QString name
 
QWidget *(* widget )()
 A function constructing the widget. More...
 
void(* populateBar )(SwitchingBar *, QWidget *)
 A function populating the SwitchingBar. More...
 

Detailed Description

An item intended to be put into WidgetRegistry.

Each RegistryItem corresponds to one widget that can be displayed in a BlendSplitter. It describes how this widget should be constructed, what is its name and what items should be in the SwitchingBar when this widget is selected.

Definition at line 17 of file RegistryItem.hpp.

Constructor & Destructor Documentation

§ RegistryItem()

RegistryItem::RegistryItem ( QString  name = "Default",
QWidget *(*)()  widget = []() ->QWidget *{return new QLabel{"Default Widget"};},
void(*)(SwitchingBar *, QWidget *)  populateBar = [](SwitchingBar *, QWidget *) ->void {} 
)

A constructor setting all the internal values.

This constructor takes 3 parameters corresponding to the 3 members of the RegistryItem class. See their desription for more details.

Parameters
nameThe name of the widget, used in the SwitchingBar combo box
widgetA pointer to a function constructing the widget
populateBarA pointer to a function populating the SwitchingBar

Member Data Documentation

§ name

QString RegistryItem::name

The name of the widget, used in the SwitchingBar combo box.

Definition at line 20 of file RegistryItem.hpp.

§ populateBar

void(* RegistryItem::populateBar) (SwitchingBar *, QWidget *)

A function populating the SwitchingBar.

A pointer to a function populating the SwitchingBar. This function is called each time this widget is selected in any SwitchingWidget. Usually this function makes use of the interface provided by SwitchingBar to populate it.

Parameters
Apointer to the SwitchingBar to be populated
Apointer to the newly-created widget in the SwitchingWidget

Definition at line 33 of file RegistryItem.hpp.

§ widget

QWidget*(* RegistryItem::widget) ()

A function constructing the widget.

A pointer to a function returning QWidget*. This function is called to construct the widget each time it is selected in any SwitchingWidget. Usually in this function the widget is dynamically created using new operator and the pointer is returned.

Returns
A pointer to the newly-created QWidget

Definition at line 26 of file RegistryItem.hpp.


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