MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / getFinalMaximumOuterSize

Method getFinalMaximumOuterSize

qcustomplot/qcustomplot.cpp:4020–4031  ·  view source on GitHub ↗

! \internal This is a helper function for the implementation of subclasses. It returns the maximum size that should finally be used for the outer rect of the passed layout element \a el. It takes into account whether a manual maximum size is set (\ref QCPLayoutElement::setMaximumSize), which size constraint is set (\ref QCPLayoutElement::setSizeConstraintRect), as well as the

Source from the content-addressed store, hash-verified

4018 size was set (\ref QCPLayoutElement::maximumOuterSizeHint).
4019*/
4020QSize QCPLayout::getFinalMaximumOuterSize(const QCPLayoutElement *el)
4021{
4022 QSize maxOuterHint = el->maximumOuterSizeHint();
4023 QSize maxOuter = el->maximumSize(); // depending on sizeConstraitRect this might be with respect to inner rect, so possibly add margins in next four lines (preserving unset maximum of QWIDGETSIZE_MAX)
4024 if (maxOuter.width() < QWIDGETSIZE_MAX && el->sizeConstraintRect() == QCPLayoutElement::scrInnerRect)
4025 maxOuter.rwidth() += el->margins().left() + el->margins().right();
4026 if (maxOuter.height() < QWIDGETSIZE_MAX && el->sizeConstraintRect() == QCPLayoutElement::scrInnerRect)
4027 maxOuter.rheight() += el->margins().top() + el->margins().bottom();
4028
4029 return QSize(maxOuter.width() < QWIDGETSIZE_MAX ? maxOuter.width() : maxOuterHint.width(),
4030 maxOuter.height() < QWIDGETSIZE_MAX ? maxOuter.height() : maxOuterHint.height());
4031}
4032
4033
4034////////////////////////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

maximumOuterSizeHintMethod · 0.80

Tested by

no test coverage detected