! \internal This function makes sure multiple axes on the side specified with \a type don't collide, but are distributed according to their respective space requirement (QCPAxis::calculateMargin). It does this by setting an appropriate offset (\ref QCPAxis::setOffset) on all axes except the one with index zero. This function is called by \ref calculateAutoMargin. */
| 17735 | This function is called by \ref calculateAutoMargin. |
| 17736 | */ |
| 17737 | void QCPAxisRect::updateAxesOffset(QCPAxis::AxisType type) |
| 17738 | { |
| 17739 | const QList<QCPAxis*> axesList = mAxes.value(type); |
| 17740 | if (axesList.isEmpty()) |
| 17741 | return; |
| 17742 | |
| 17743 | bool isFirstVisible = !axesList.first()->visible(); // if the first axis is visible, the second axis (which is where the loop starts) isn't the first visible axis, so initialize with false |
| 17744 | for (int i=1; i<axesList.size(); ++i) |
| 17745 | { |
| 17746 | int offset = axesList.at(i-1)->offset() + axesList.at(i-1)->calculateMargin(); |
| 17747 | if (axesList.at(i)->visible()) // only add inner tick length to offset if this axis is visible and it's not the first visible one (might happen if true first axis is invisible) |
| 17748 | { |
| 17749 | if (!isFirstVisible) |
| 17750 | offset += axesList.at(i)->tickLengthIn(); |
| 17751 | isFirstVisible = false; |
| 17752 | } |
| 17753 | axesList.at(i)->setOffset(offset); |
| 17754 | } |
| 17755 | } |
| 17756 | |
| 17757 | /* inherits documentation from base class */ |
| 17758 | int QCPAxisRect::calculateAutoMargin(QCP::MarginSide side) |
nothing calls this directly
no test coverage detected