MCPcopy Create free account
hub / github.com/LUX-Core/lux / update

Method update

src/qt/qcustomplot.cpp:3405–3430  ·  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

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

Callers 2

replotMethod · 0.45
updateLayoutMethod · 0.45

Calls 8

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

Tested by

no test coverage detected