Wizualizacja konfiguracji dłoni  1.0
Dokumentacja klasy QCPMarginGroup

A margin group allows synchronization of margin sides if working with multiple layout elements. Więcej...

#include <qcustomplot.hh>

Diagram dziedziczenia dla QCPMarginGroup
Diagram współpracy dla QCPMarginGroup:

Metody publiczne

 QCPMarginGroup (QCustomPlot *parentPlot)
 
virtual ~QCPMarginGroup ()
 
QList< QCPLayoutElement * > elements (QCP::MarginSide side) const
 
bool isEmpty () const
 
void clear ()
 

Metody chronione

virtual int commonMargin (QCP::MarginSide side) const
 
void addChild (QCP::MarginSide side, QCPLayoutElement *element)
 
void removeChild (QCP::MarginSide side, QCPLayoutElement *element)
 

Atrybuty chronione

QCustomPlotmParentPlot
 
QHash< QCP::MarginSide, QList< QCPLayoutElement * > > mChildren
 

Przyjaciele

class QCPLayoutElement
 

Opis szczegółowy

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.


QCPMarginGroup.png
Demonstration of QCPMarginGroup


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.

Example

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.

Dokumentacja konstruktora i destruktora

QCPMarginGroup::QCPMarginGroup ( QCustomPlot parentPlot)
explicit

Creates a new QCPMarginGroup instance in parentPlot.

QCPMarginGroup::~QCPMarginGroup ( )
virtual

Dokumentacja funkcji składowych

void QCPMarginGroup::addChild ( QCP::MarginSide  side,
QCPLayoutElement element 
)
protected
void QCPMarginGroup::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.

int QCPMarginGroup::commonMargin ( QCP::MarginSide  side) const
protectedvirtual
QList< QCPLayoutElement * > QCPMarginGroup::elements ( QCP::MarginSide  side) const
inline

Returns a list of all layout elements that have their margin side associated with this margin group.

bool QCPMarginGroup::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.

void QCPMarginGroup::removeChild ( QCP::MarginSide  side,
QCPLayoutElement element 
)
protected

Dokumentacja przyjaciół i funkcji związanych

friend class QCPLayoutElement
friend

Dokumentacja atrybutów składowych

QHash<QCP::MarginSide, QList<QCPLayoutElement*> > QCPMarginGroup::mChildren
protected
QCustomPlot* QCPMarginGroup::mParentPlot
protected

Dokumentacja dla tej klasy została wygenerowana z plików: