! \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
| 4018 | size was set (\ref QCPLayoutElement::maximumOuterSizeHint). |
| 4019 | */ |
| 4020 | QSize 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 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected