QCPLayoutElement

Search for usage in LXR

Inheritance diagram for QCPLayoutElement:

Public Types

enum  SizeConstraintRect { scrInnerRect, scrOuterRect }
 
enum  UpdatePhase { upPreparation, upMargins, upLayout }
 

Public Member Functions

 QCPLayoutElement (QCustomPlot *parentPlot=nullptr)
 
QCP::MarginSides autoMargins () const
 
virtual QList< QCPLayoutElement * > elements (bool recursive) const
 
QCPLayoutlayout () const
 
QCPMarginGroupmarginGroup (QCP::MarginSide side) const
 
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups () const
 
QMargins margins () const
 
virtual QSize maximumOuterSizeHint () const
 
QSize maximumSize () const
 
QMargins minimumMargins () const
 
virtual QSize minimumOuterSizeHint () const
 
QSize minimumSize () const
 
QRect outerRect () const
 
QRect rect () const
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const override
 
void setAutoMargins (QCP::MarginSides sides)
 
void setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group)
 
void setMargins (const QMargins &margins)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int width, int height)
 
void setMinimumMargins (const QMargins &margins)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int width, int height)
 
void setOuterRect (const QRect &rect)
 
void setSizeConstraintRect (SizeConstraintRect constraintRect)
 
SizeConstraintRect sizeConstraintRect () const
 
virtual void update (UpdatePhase phase)
 
- Public Member Functions inherited from QCPLayerable
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=nullptr)
 
bool antialiased () const
 
QCPLayerlayer () const
 
QCPLayerableparentLayerable () const
 
QCustomPlotparentPlot () const
 
bool realVisibility () const
 
void setAntialiased (bool enabled)
 
bool setLayer (const QString &layerName)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
void setVisible (bool on)
 
bool visible () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const override
 
virtual int calculateAutoMargin (QCP::MarginSide side)
 
virtual void draw (QCPPainter *painter) override
 
virtual void layoutChanged ()
 
virtual void parentPlotInitialized (QCustomPlot *parentPlot) override
 
- Protected Member Functions inherited from QCPLayerable
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 
virtual QRect clipRect () const
 
virtual void deselectEvent (bool *selectionStateChanged)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details)
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details)
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
 
virtual QCP::Interaction selectionCategory () const
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
virtual void wheelEvent (QWheelEvent *event)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

QCP::MarginSides mAutoMargins
 
QHash< QCP::MarginSide, QCPMarginGroup * > mMarginGroups
 
QMargins mMargins
 
QSize mMaximumSize
 
QMargins mMinimumMargins
 
QSize mMinimumSize
 
QRect mOuterRect
 
QCPLayoutmParentLayout
 
QRect mRect
 
SizeConstraintRect mSizeConstraintRect
 
- Protected Attributes inherited from QCPLayerable
bool mAntialiased
 
QCPLayermLayer
 
QPointer< QCPLayerablemParentLayerable
 
QCustomPlotmParentPlot
 
bool mVisible
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Signals inherited from QCPLayerable
void layerChanged (QCPLayer *newLayer)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

The abstract base class for all objects that form the layout system.

This is an abstract base class. As such, it can't be instantiated directly, rather use one of its subclasses.

A Layout element is a rectangular object which can be placed in layouts. It has an outer rect (QCPLayoutElement::outerRect) and an inner rect (QCPLayoutElement::rect). The difference between outer and inner rect is called its margin. The margin can either be set to automatic or manual (setAutoMargins) on a per-side basis. If a side is set to manual, that margin can be set explicitly with setMargins and will stay fixed at that value. If it's set to automatic, the layout element subclass will control the value itself (via calculateAutoMargin).

Layout elements can be placed in layouts (base class QCPLayout) like QCPLayoutGrid. The top level layout is reachable via QCustomPlot::plotLayout, and is a QCPLayoutGrid. Since QCPLayout itself derives from QCPLayoutElement, layouts can be nested.

Thus in QCustomPlot one can divide layout elements into two categories: The ones that are invisible by themselves, because they don't draw anything. Their only purpose is to manage the position and size of other layout elements. This category of layout elements usually use QCPLayout as base class. Then there is the category of layout elements which actually draw something. For example, QCPAxisRect, QCPLegend and QCPTextElement are of this category. This does not necessarily mean that the latter category can't have child layout elements. QCPLegend for instance, actually derives from QCPLayoutGrid and the individual legend items are child layout elements in the grid layout.

Definition at line 1185 of file qcustomplot.h.

Member Enumeration Documentation

◆ SizeConstraintRect

Defines to which rect of a layout element the size constraints that can be set via setMinimumSize and setMaximumSize apply. The outer rect (outerRect) includes the margins (e.g. in the case of a QCPAxisRect the axis labels), whereas the inner rect (rect) does not.

See also
setSizeConstraintRect
Enumerator
scrInnerRect 

Minimum/Maximum size constraints apply to inner rect.

scrOuterRect 

Minimum/Maximum size constraints apply to outer rect, thus include layout element margins.

Definition at line 1217 of file qcustomplot.h.

◆ UpdatePhase

Defines the phases of the update process, that happens just before a replot. At each phase, Update your custom dialog is called with the according UpdatePhase value.

Enumerator
upPreparation 

Phase used for any type of preparation that needs to be done before margin calculation and layout.

upMargins 

Phase in which the margins are calculated and set.

upLayout 

Final phase in which the layout system places the rects of the elements.

Definition at line 1203 of file qcustomplot.h.

Constructor & Destructor Documentation

◆ QCPLayoutElement()

QCPLayoutElement::QCPLayoutElement ( QCustomPlot parentPlot = nullptr)
explicit

Creates an instance of QCPLayoutElement and sets default values.

Definition at line 3189 of file qcustomplot.cpp.

Member Function Documentation

◆ applyDefaultAntialiasingHint()

virtual void QCPLayoutElement::applyDefaultAntialiasingHint ( QCPPainter painter) const
inlineoverrideprotectedvirtual

This function applies the default antialiasing setting to the specified painter, using the function applyAntialiasingHint. It is the antialiasing state the painter is put in, when draw is called on the layerable. If the layerable has multiple entities whose antialiasing setting may be specified individually, this function should set the antialiasing state of the most prominent entity. In this case however, the draw function usually calls the specialized versions of this function before drawing each entity, effectively overriding the setting of the default antialiasing hint.

First example: QCPGraph has multiple entities that have an antialiasing setting: The graph line, fills and scatters. Those can be configured via QCPGraph::setAntialiased, QCPGraph::setAntialiasedFill and QCPGraph::setAntialiasedScatters. Consequently, there isn't only the QCPGraph::applyDefaultAntialiasingHint function (which corresponds to the graph line's antialiasing), but specialized ones like QCPGraph::applyFillAntialiasingHint and QCPGraph::applyScattersAntialiasingHint. So before drawing one of those entities, QCPGraph::draw calls the respective specialized applyAntialiasingHint function.

Second example: QCPItemLine consists only of a line so there is only one antialiasing setting which can be controlled with QCPItemLine::setAntialiased. (This function is inherited by all layerables. The specialized functions, as seen on QCPGraph, must be added explicitly to the respective layerable subclass.) Consequently it only has the normal QCPItemLine::applyDefaultAntialiasingHint. The QCPItemLine::draw function doesn't need to care about setting any antialiasing states, because the default antialiasing hint is already set on the painter when the draw function is called, and that's the state it wants to draw the line with.

Implements QCPLayerable.

Reimplemented in QCPPolarAxisAngular, QCPColorScale, QCPTextElement, QCPLegend, QCPAbstractLegendItem, and QCPAxisRect.

Definition at line 1274 of file qcustomplot.h.

◆ calculateAutoMargin()

int QCPLayoutElement::calculateAutoMargin ( QCP::MarginSide  side)
protectedvirtual

Returns the margin size for this side. It is used if automatic margins is enabled for this side (see setAutoMargins). If a minimum margin was set with setMinimumMargins, the returned value will not be smaller than the specified minimum margin.

The default implementation just returns the respective manual margin (setMargins) or the minimum margin, whichever is larger.

Reimplemented in QCPAxisRect.

Definition at line 3550 of file qcustomplot.cpp.

◆ draw()

virtual void QCPLayoutElement::draw ( QCPPainter painter)
inlineoverrideprotectedvirtual

This function draws the layerable with the specified painter. It is only called by QCustomPlot, if the layerable is visible (setVisible).

Before this function is called, the painter's antialiasing state is set via applyDefaultAntialiasingHint, see the documentation there. Further, the clipping rectangle was set to clipRect.

Implements QCPLayerable.

Reimplemented in QCPAbstractLegendItem, QCPPolarLegendItem, QCPPolarAxisAngular, QCPColorScaleAxisRectPrivate, QCPTextElement, QCPLegend, QCPPlottableLegendItem, and QCPAxisRect.

Definition at line 1275 of file qcustomplot.h.

◆ elements()

QList< QCPLayoutElement * > QCPLayoutElement::elements ( bool  recursive) const
virtual

Returns a list of all child elements in this layout element. If recursive is true, all sub-child elements are included in the list, too.

Warning
There may be nullptr entries in the returned list. For example, QCPLayoutGrid may have empty cells which yield nullptr at the respective index.

Reimplemented in QCPPolarAxisAngular, QCPAxisRect, QCPLayoutGrid, and QCPLayout.

Definition at line 3490 of file qcustomplot.cpp.

◆ layout()

QCPLayout * QCPLayoutElement::layout ( ) const
inline

Returns the parent layout of this layout element.

Definition at line 1226 of file qcustomplot.h.

◆ layoutChanged()

void QCPLayoutElement::layoutChanged ( )
protectedvirtual

This virtual method is called when this layout element was moved to a different QCPLayout, or when this layout element has changed its logical position (e.g. row and/or column) within the same QCPLayout. Subclasses may use this to react accordingly.

Since this method is called after the completion of the move, you can access the new parent layout via layout().

The default implementation does nothing.

Reimplemented in QCPAxisRect.

Definition at line 3566 of file qcustomplot.cpp.

◆ maximumOuterSizeHint()

QSize QCPLayoutElement::maximumOuterSizeHint ( ) const
virtual

Returns the suggested maximum size this layout element (the outerRect) may be expanded to, if no manual maximum size is set.

if a maximum size (setMaximumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMaximumOuterSize) to determine the maximum allowed size of this layout element.

A manual maximum size is considered set if it is smaller than Qt's QWIDGETSIZE_MAX.

The default implementation simply returns QWIDGETSIZE_MAX for both width and height, implying no suggested maximum size. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented in QCPTextElement, and QCPLayoutGrid.

Definition at line 3478 of file qcustomplot.cpp.

◆ minimumOuterSizeHint()

QSize QCPLayoutElement::minimumOuterSizeHint ( ) const
virtual

Returns the suggested minimum size this layout element (the outerRect) may be compressed to, if no manual minimum size is set.

if a minimum size (setMinimumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMinimumOuterSize) to determine the minimum allowed size of this layout element.

A manual minimum size is considered set if it is non-zero.

The default implementation simply returns the sum of the horizontal margins for the width and the sum of the vertical margins for the height. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented in QCPPolarLegendItem, QCPTextElement, QCPPlottableLegendItem, and QCPLayoutGrid.

Definition at line 3459 of file qcustomplot.cpp.

◆ outerRect()

QRect QCPLayoutElement::outerRect ( ) const
inline

Returns the outer rect of this layout element. The outer rect is the inner rect expanded by the margins (setMargins, setAutoMargins). The outer rect is used (and set via setOuterRect) by the parent QCPLayout to control the size of this layout element.

See also
rect

Definition at line 1228 of file qcustomplot.h.

◆ parentPlotInitialized()

void QCPLayoutElement::parentPlotInitialized ( QCustomPlot parentPlot)
overrideprotectedvirtual

propagates the parent plot initialization to all child elements, by calling QCPLayerable::initializeParentPlot on them.

Reimplemented from QCPLayerable.

Reimplemented in QCPLegend.

Definition at line 3532 of file qcustomplot.cpp.

◆ rect()

QRect QCPLayoutElement::rect ( ) const
inline

Returns the inner rect of this layout element. The inner rect is the outer rect (outerRect, setOuterRect) shrinked by the margins (setMargins, setAutoMargins).

In some cases, the area between outer and inner rect is left blank. In other cases the margin area is used to display peripheral graphics while the main content is in the inner rect. This is where automatic margin calculation becomes interesting because it allows the layout element to adapt the margins to the peripheral graphics it wants to draw. For example, QCPAxisRect draws the axis labels and tick labels in the margin area, thus needs to adjust the margins (if setAutoMargins is enabled) according to the space required by the labels of the axes.

See also
outerRect

Definition at line 1227 of file qcustomplot.h.

◆ selectTest()

double QCPLayoutElement::selectTest ( const QPointF pos,
bool  onlySelectable,
QVariant details = nullptr 
) const
overridevirtual

Layout elements are sensitive to events inside their outer rect. If pos is within the outer rect, this method returns a value corresponding to 0.99 times the parent plot's selection tolerance. However, layout elements are not selectable by default. So if onlySelectable is true, -1.0 is returned.

See QCPLayerable::selectTest for a general explanation of this virtual method.

QCPLayoutElement subclasses may reimplement this method to provide more specific selection test behaviour.

Reimplemented from QCPLayerable.

Reimplemented in QCPTextElement, QCPLegend, QCPAbstractLegendItem, QCPLayoutInset, and QCPPolarAxisAngular.

Definition at line 3507 of file qcustomplot.cpp.

◆ setAutoMargins()

void QCPLayoutElement::setAutoMargins ( QCP::MarginSides  sides)

Sets on which sides the margin shall be calculated automatically. If a side is calculated automatically, a minimum margin value may be provided with setMinimumMargins. If a side is set to be controlled manually, the value may be specified with setMargins.

Margin sides that are under automatic control may participate in a QCPMarginGroup (see setMarginGroup), to synchronize (align) it with other layout elements in the plot.

See also
setMinimumMargins, setMargins, QCP::MarginSide

Definition at line 3278 of file qcustomplot.cpp.

◆ setMarginGroup()

void QCPLayoutElement::setMarginGroup ( QCP::MarginSides  sides,
QCPMarginGroup group 
)

Sets the margin group of the specified margin sides.

Margin groups allow synchronizing specified margins across layout elements, see the documentation of QCPMarginGroup.

To unset the margin group of sides, set group to nullptr.

Note that margin groups only work for margin sides that are set to automatic (setAutoMargins).

See also
QCP::MarginSide

Definition at line 3378 of file qcustomplot.cpp.

◆ setMargins()

void QCPLayoutElement::setMargins ( const QMargins margins)

Sets the margins of this layout element. If setAutoMargins is disabled for some or all sides, this function is used to manually set the margin on those sides. Sides that are still set to be handled automatically are ignored and may have any value in margins.

The margin is the distance between the outer rect (controlled by the parent layout via setOuterRect) and the inner rect (which usually contains the main content of this layout element).

See also
setAutoMargins

Definition at line 3242 of file qcustomplot.cpp.

◆ setMaximumSize() [1/2]

void QCPLayoutElement::setMaximumSize ( const QSize size)

Sets the maximum size of this layout element. A parent layout tries to respect the size here by changing row/column sizes in the layout accordingly.

Whether this constraint applies to the inner or the outer rect can be specified with setSizeConstraintRect (see rect and outerRect).

Definition at line 3324 of file qcustomplot.cpp.

◆ setMaximumSize() [2/2]

void QCPLayoutElement::setMaximumSize ( int  width,
int  height 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Sets the maximum size of this layout element.

Whether this constraint applies to the inner or the outer rect can be specified with setSizeConstraintRect (see rect and outerRect).

Definition at line 3341 of file qcustomplot.cpp.

◆ setMinimumMargins()

void QCPLayoutElement::setMinimumMargins ( const QMargins margins)

If setAutoMargins is enabled on some or all margins, this function is used to provide minimum values for those margins.

The minimum values are not enforced on margin sides that were set to be under manual control via setAutoMargins.

See also
setAutoMargins

Definition at line 3260 of file qcustomplot.cpp.

◆ setMinimumSize() [1/2]

void QCPLayoutElement::setMinimumSize ( const QSize size)

Sets the minimum size of this layout element. A parent layout tries to respect the size here by changing row/column sizes in the layout accordingly.

If the parent layout size is not sufficient to satisfy all minimum size constraints of its child layout elements, the layout may set a size that is actually smaller than size. QCustomPlot propagates the layout's size constraints to the outside by setting its own minimum QWidget size accordingly, so violations of size should be exceptions.

Whether this constraint applies to the inner or the outer rect can be specified with setSizeConstraintRect (see rect and outerRect).

Definition at line 3295 of file qcustomplot.cpp.

◆ setMinimumSize() [2/2]

void QCPLayoutElement::setMinimumSize ( int  width,
int  height 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Sets the minimum size of this layout element.

Whether this constraint applies to the inner or the outer rect can be specified with setSizeConstraintRect (see rect and outerRect).

Definition at line 3312 of file qcustomplot.cpp.

◆ setOuterRect()

void QCPLayoutElement::setOuterRect ( const QRect rect)

Sets the outer rect of this layout element. If the layout element is inside a layout, the layout sets the position and size of this layout element using this function.

Calling this function externally has no effect, since the layout will overwrite any changes to the outer rect upon the next replot.

The layout element will adapt its inner rect by applying the margins inward to the outer rect.

See also
rect

Definition at line 3222 of file qcustomplot.cpp.

◆ setSizeConstraintRect()

void QCPLayoutElement::setSizeConstraintRect ( SizeConstraintRect  constraintRect)

Sets to which rect of a layout element the size constraints apply. Size constraints can be set via setMinimumSize and setMaximumSize.

The outer rect (outerRect) includes the margins (e.g. in the case of a QCPAxisRect the axis labels), whereas the inner rect (rect) does not.

See also
setMinimumSize, setMaximumSize

Definition at line 3355 of file qcustomplot.cpp.

◆ update()

void QCPLayoutElement::update ( UpdatePhase  phase)
virtual

Updates the layout element and sub-elements. This function is automatically called before every replot by the parent layout element. It is called multiple times, once for every UpdatePhase. The phases are run through in the order of the enum values. For details about what happens at the different phases, see the documentation of UpdatePhase.

Layout elements that have child elements should call the Update your custom dialog method of their child elements, and pass the current phase unchanged.

The default implementation executes the automatic margin mechanism in the upMargins phase. Subclasses should make sure to call the base class implementation.

Reimplemented in QCPPolarAxisAngular, QCPColorScale, QCPAxisRect, and QCPLayout.

Definition at line 3418 of file qcustomplot.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 18 2022 03:56:48 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.