|
SETestKCL
1.0.
|
#include <qcustomplot.h>


Public Member Functions | |
| QCPMarginGroup (QCustomPlot *parentPlot) | |
| ~QCPMarginGroup () | |
| QList< QCPLayoutElement * > | elements (QCP::MarginSide side) const |
| bool | isEmpty () const |
| void | clear () |
Protected Member Functions | |
| int | commonMargin (QCP::MarginSide side) const |
| void | addChild (QCP::MarginSide side, QCPLayoutElement *element) |
| void | removeChild (QCP::MarginSide side, QCPLayoutElement *element) |
Protected Attributes | |
| QCustomPlot * | mParentPlot |
| QHash< QCP::MarginSide, QList < QCPLayoutElement * > > | mChildren |
Friends | |
| class | QCPLayoutElement |
A margin group allows synchronization of margin sides if working with multiple layout elements.
QCPMarginGroup allows you to tie a margin side of two or more layout elements together, such that they will all have the same size, based on the largest required margin in the group.
In certain situations it is desirable that margins at specific sides are synchronized across layout elements. For example, if one QCPAxisRect is below another one in a grid layout, it will provide a cleaner look to the user if the left and right margins of the two axis rects are of the same size. The left axis of the top axis rect will then be at the same horizontal position as the left axis of the lower axis rect, making them appear aligned. The same applies for the right axes. This is what QCPMarginGroup makes possible.
To add/remove a specific side of a layout element to/from a margin group, use the QCPLayoutElement::setMarginGroup method. To completely break apart the margin group, either call clear, or just delete the margin group.
First create a margin group:
Then set this group on the layout element sides:
Here, we've used the first two axis rects of the plot and synchronized their left margins with each other and their right margins with each other.
Definition at line 600 of file qcustomplot.h.
| QCPMarginGroup | ( | QCustomPlot * | parentPlot | ) |
Creates a new QCPMarginGroup instance in parentPlot.
Definition at line 1537 of file qcustomplot.cpp.
References mChildren, QCP::msBottom, QCP::msLeft, QCP::msRight, and QCP::msTop.
| ~QCPMarginGroup | ( | ) |
Definition at line 1547 of file qcustomplot.cpp.
References clear().
|
protected |
Definition at line 1617 of file qcustomplot.cpp.
References mChildren.
Referenced by QCPLayoutElement::setMarginGroup().
| void clear | ( | ) |
Clears this margin group. The synchronization of the margin sides that use this margin group is lifted and they will use their individual margin sizes again.
Definition at line 1572 of file qcustomplot.cpp.
References elements(), and mChildren.
Referenced by ~QCPMarginGroup().
|
protected |
Definition at line 1595 of file qcustomplot.cpp.
References elements(), QCP::getMarginValue(), and mChildren.
|
inline |
Returns a list of all layout elements that have their margin side associated with this margin group.
Definition at line 608 of file qcustomplot.h.
Referenced by clear(), and commonMargin().
| bool isEmpty | ( | ) | const |
Returns whether this margin group is empty. If this function returns true, no layout elements use this margin group to synchronize margin sides.
Definition at line 1556 of file qcustomplot.cpp.
References mChildren.
|
protected |
Definition at line 1631 of file qcustomplot.cpp.
References mChildren.
Referenced by QCPLayoutElement::setMarginGroup().
|
friend |
Definition at line 625 of file qcustomplot.h.
|
protected |
Definition at line 615 of file qcustomplot.h.
Referenced by addChild(), clear(), commonMargin(), isEmpty(), QCPMarginGroup(), and removeChild().
|
protected |
Definition at line 614 of file qcustomplot.h.
1.8.5