! \internal This is a helper function for the implementation of subclasses. It returns the minimum size that should finally be used for the outer rect of the passed layout element \a el. It takes into account whether a manual minimum size is set (\ref QCPLayoutElement::setMinimumSize), which size constraint is set (\ref QCPLayoutElement::setSizeConstraintRect), as well as the
| 3993 | size was set (\ref QCPLayoutElement::minimumOuterSizeHint). |
| 3994 | */ |
| 3995 | QSize QCPLayout::getFinalMinimumOuterSize(const QCPLayoutElement *el) |
| 3996 | { |
| 3997 | QSize minOuterHint = el->minimumOuterSizeHint(); |
| 3998 | QSize minOuter = el->minimumSize(); // depending on sizeConstraitRect this might be with respect to inner rect, so possibly add margins in next four lines (preserving unset minimum of 0) |
| 3999 | if (minOuter.width() > 0 && el->sizeConstraintRect() == QCPLayoutElement::scrInnerRect) |
| 4000 | minOuter.rwidth() += el->margins().left() + el->margins().right(); |
| 4001 | if (minOuter.height() > 0 && el->sizeConstraintRect() == QCPLayoutElement::scrInnerRect) |
| 4002 | minOuter.rheight() += el->margins().top() + el->margins().bottom(); |
| 4003 | |
| 4004 | return QSize(minOuter.width() > 0 ? minOuter.width() : minOuterHint.width(), |
| 4005 | minOuter.height() > 0 ? minOuter.height() : minOuterHint.height());; |
| 4006 | } |
| 4007 | |
| 4008 | /*! \internal |
| 4009 |
nothing calls this directly
no test coverage detected