BlendSplitter
3.0.0
A Blender-like Qt Widget management library
|
A user-defined Splitter. More...
#include <BlendSplitter.hpp>
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 |
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:
Definition at line 31 of file BlendSplitter.hpp.
BlendSplitter::BlendSplitter | ( | QWidget *(*)() | defaultWidget = []() ->QWidget *{return new SwitchingWidget{};} , |
Qt::Orientation | orientation = Qt::Horizontal |
||
) |
BlendSplitter class constructor.
defaultWidget | A pointer to function constructing the default widget. This function is called when a new widget is added to BlendSplitter. |
orientation | Orientation of the main BlendSplitter |
void BlendSplitter::addSplitter | ( | BlendSplitter * | splitter | ) |
Add another BlendSplitter to this BlendSplitter.
Adds a BlendSplitter (usually with parallel orientation) to the BlendSplitter
splitter | A pointer to the BlendSplitter to be added |
void BlendSplitter::addWidget | ( | ) |
Add a widget to the BlendSplitter.
Adds the default widget to the very bottom/right of the BlendSplitter.
void BlendSplitter::addWidget | ( | QWidget * | widget | ) |
Add a widget to the BlendSplitter.
Adds the specified widget to the very bottom/right of the BlendSplitter
widget | A pointer to the widget to be added |
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
item | A RegistryItem to be added (inside a SwitchingWidget). |
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).
index | The desired position |
splitter | A pointer to the BlendSplitter to be inserted |
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.
index | The desired position |
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.
index | The desired position |
widget | A pointer to the widget to be inserted |
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.
index | The desired position |
item | A RegistryItem to be added (inside a SwitchingWidget). |
|
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.
|
static |
Size of the expanders in the corners. Default value: 12
Definition at line 36 of file BlendSplitter.hpp.
|
static |
Height of the SwitchingBar. Default value: 36
Definition at line 37 of file BlendSplitter.hpp.