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

A user-defined Splitter. More...

#include <BlendSplitter.hpp>

Inheritance diagram for BlendSplitter:
Collaboration diagram for BlendSplitter:

Public Member Functions

 BlendSplitter (QWidget *(*defaultWidget)()=[]() ->QWidget *{return new SwitchingWidget{};}, Qt::Orientation orientation=Qt::Horizontal)
 BlendSplitter class constructor. More...
 
void addWidget ()
 Add a widget to the BlendSplitter. More...
 
void addWidget (QWidget *widget)
 Add a widget to the BlendSplitter. More...
 
void addWidget (RegistryItem *item)
 Add a widget to the BlendSplitter. More...
 
void insertWidget (int index)
 Insert a widget into the BlendSplitter. More...
 
void insertWidget (int index, QWidget *widget)
 Insert a widget into the BlendSplitter. More...
 
void insertWidget (int index, RegistryItem *item)
 Insert a widget into the BlendSplitter. More...
 
void addSplitter (BlendSplitter *splitter)
 Add another BlendSplitter to this BlendSplitter. More...
 
void insertSplitter (int index, BlendSplitter *splitter)
 Insert another BlendSplitter into this BlendSplitter. More...
 

Static Public Attributes

static int expanderSize
 
static int switchingBarHeight
 
static QString expanderImage
 

Detailed Description

A user-defined Splitter.

This widget implements the functionality of Blender (Open-source 3D modelling software) widget management. This widget displays a splitter similar to QSplitter. However, each widget in BlendSplitter has a pair of Expanders (one in top right and one in bottom left corner). By dragging from these Expanders inwards a new widget is created in the direction of the drag. If the direction is different to that of the BlendSplitter, a new BlendSplitter with parallel direction is created in place of the widget with the widget and the new widget in it. By dragging from these expanders outwards, a neighbouring widget (or a collection of widgets) can be closed. While the mouse is held, the widgets to be closed are marked with black overlay. When the mouse is released, they are closed. BlendSplitter can be used like any other QWidget, although setting one as the central widget is recommended. A BlendSplitter can contain any QWidget, but to achieve best results, use it together with SwitchingWidget.

BlendSplitter provides 3 static variables that allow some customization of the library design. These are expanderSize, switchingBarHeight and expanderImage. These are all initialized with default values. The default Expander image is provided by the library.

The default Expander image:

expander.png
The default Expander

Definition at line 31 of file BlendSplitter.hpp.

Constructor & Destructor Documentation

§ BlendSplitter()

BlendSplitter::BlendSplitter ( QWidget *(*)()  defaultWidget = []() ->QWidget *{return new SwitchingWidget{};},
Qt::Orientation  orientation = Qt::Horizontal 
)

BlendSplitter class constructor.

Parameters
defaultWidgetA pointer to function constructing the default widget. This function is called when a new widget is added to BlendSplitter.
orientationOrientation of the main BlendSplitter

Member Function Documentation

§ addSplitter()

void BlendSplitter::addSplitter ( BlendSplitter splitter)

Add another BlendSplitter to this BlendSplitter.

Adds a BlendSplitter (usually with parallel orientation) to the BlendSplitter

Parameters
splitterA pointer to the BlendSplitter to be added

§ addWidget() [1/3]

void BlendSplitter::addWidget ( )

Add a widget to the BlendSplitter.

Adds the default widget to the very bottom/right of the BlendSplitter.

§ addWidget() [2/3]

void BlendSplitter::addWidget ( QWidget *  widget)

Add a widget to the BlendSplitter.

Adds the specified widget to the very bottom/right of the BlendSplitter

Parameters
widgetA pointer to the widget to be added

§ addWidget() [3/3]

void BlendSplitter::addWidget ( RegistryItem item)

Add a widget to the BlendSplitter.

Adds the specified widget from the WidgetRegistry to the very bottom/right of the BlendSplitter

Parameters
itemA RegistryItem to be added (inside a SwitchingWidget).

§ insertSplitter()

void BlendSplitter::insertSplitter ( int  index,
BlendSplitter splitter 
)

Insert another BlendSplitter into this BlendSplitter.

Inserts a BlendSplitter (usually with parallel orientation) into the BlendSplitter at the given position counting from top/left (counting starts at 0).

Parameters
indexThe desired position
splitterA pointer to the BlendSplitter to be inserted

§ insertWidget() [1/3]

void BlendSplitter::insertWidget ( int  index)

Insert a widget into the BlendSplitter.

Inserts the default widget into the BlendSplitter at the given position counting from top/left (counting starts at 0). This function should NOT be called with a BlendSplitter as a parameter.

Parameters
indexThe desired position

§ insertWidget() [2/3]

void BlendSplitter::insertWidget ( int  index,
QWidget *  widget 
)

Insert a widget into the BlendSplitter.

Inserts the specified widget into the BlendSplitter at the given position counting from top/left (counting starts at 0). This function should NOT be called with a BlendSplitter as a parameter.

Parameters
indexThe desired position
widgetA pointer to the widget to be inserted

§ insertWidget() [3/3]

void BlendSplitter::insertWidget ( int  index,
RegistryItem item 
)

Insert a widget into the BlendSplitter.

Inserts the specified widget from WidgetRegistry into the BlendSplitter at the given position counting from top/left (counting starts at 0). This function should NOT be called with a BlendSplitter as a parameter.

Parameters
indexThe desired position
itemA RegistryItem to be added (inside a SwitchingWidget).

Member Data Documentation

§ expanderImage

QString BlendSplitter::expanderImage
static

The image to be used for the top left expander. The bottom right one will rotate this by pi (180 degrees). Default value: ":/BlendSplitter/Expander"

Definition at line 38 of file BlendSplitter.hpp.

§ expanderSize

int BlendSplitter::expanderSize
static

Size of the expanders in the corners. Default value: 12

Definition at line 36 of file BlendSplitter.hpp.

§ switchingBarHeight

int BlendSplitter::switchingBarHeight
static

Height of the SwitchingBar. Default value: 36

Definition at line 37 of file BlendSplitter.hpp.


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