MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / update

Method update

qcustomplot.cpp:3411–3436  ·  view source on GitHub ↗

! 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 \ref 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 \ref UpdatePhase. Layout elements that have child

Source from the content-addressed store, hash-verified

3409 Subclasses should make sure to call the base class implementation.
3410*/
3411void QCPLayoutElement::update(UpdatePhase phase)
3412{
3413 if (phase == upMargins)
3414 {
3415 if (mAutoMargins != QCP::msNone)
3416 {
3417 // set the margins of this layout element according to automatic margin calculation, either directly or via a margin group:
3418 QMargins newMargins = mMargins;
3419 QList<QCP::MarginSide> allMarginSides = QList<QCP::MarginSide>() << QCP::msLeft << QCP::msRight << QCP::msTop << QCP::msBottom;
3420 foreach (QCP::MarginSide side, allMarginSides)
3421 {
3422 if (mAutoMargins.testFlag(side)) // this side's margin shall be calculated automatically
3423 {
3424 if (mMarginGroups.contains(side))
3425 QCP::setMarginValue(newMargins, side, mMarginGroups[side]->commonMargin(side)); // this side is part of a margin group, so get the margin value from that group
3426 else
3427 QCP::setMarginValue(newMargins, side, calculateAutoMargin(side)); // this side is not part of a group, so calculate the value directly
3428 // apply minimum margin restrictions:
3429 if (QCP::getMarginValue(newMargins, side) < QCP::getMarginValue(mMinimumMargins, side))
3430 QCP::setMarginValue(newMargins, side, QCP::getMarginValue(mMinimumMargins, side));
3431 }
3432 }
3433 setMargins(newMargins);
3434 }
3435 }
3436}
3437
3438/*!
3439 Returns the suggested minimum size this layout element (the \ref outerRect) may be compressed to,

Callers 7

updateSidebarMethod · 0.45
setCellTextStateMethod · 0.45
setReferenceMethod · 0.45
updateDataMethod · 0.45
setUsedMethod · 0.45
replotMethod · 0.45
updateLayoutMethod · 0.45

Calls 7

elementCountFunction · 0.85
rectFunction · 0.85
setupTickVectorsMethod · 0.80
atMethod · 0.80
setOuterRectMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected