! \internal Returns the spacing in pixels which is between this \a bars and the following one, both at the key coordinate \a keyCoord. \note Typically the returned value doesn't depend on \a bars or \a keyCoord. \a bars is only needed to get access to the key axis transformation and axis rect for the modes \ref stAxisRectRatio and \ref stPlotCoords. The \a keyCoord is only relevant
| 24252 | \ref stPlotCoords on a logarithmic axis. |
| 24253 | */ |
| 24254 | double QCPBarsGroup::getPixelSpacing(const QCPBars *bars, double keyCoord) |
| 24255 | { |
| 24256 | switch (mSpacingType) |
| 24257 | { |
| 24258 | case stAbsolute: |
| 24259 | { |
| 24260 | return mSpacing; |
| 24261 | } |
| 24262 | case stAxisRectRatio: |
| 24263 | { |
| 24264 | if (bars->keyAxis()->orientation() == Qt::Horizontal) |
| 24265 | return bars->keyAxis()->axisRect()->width()*mSpacing; |
| 24266 | else |
| 24267 | return bars->keyAxis()->axisRect()->height()*mSpacing; |
| 24268 | } |
| 24269 | case stPlotCoords: |
| 24270 | { |
| 24271 | double keyPixel = bars->keyAxis()->coordToPixel(keyCoord); |
| 24272 | return qAbs(bars->keyAxis()->coordToPixel(keyCoord+mSpacing)-keyPixel); |
| 24273 | } |
| 24274 | } |
| 24275 | return 0; |
| 24276 | } |
| 24277 | |
| 24278 | |
| 24279 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected