! Moves this bars plottable above \a bars. In other words, the bars of this plottable will appear above the bars of \a bars. The move target \a bars must use the same key and value axis as this plottable. Inserting into and removing from existing bar stacking is handled gracefully. If \a bars already has a bars object above itself, this bars object is inserted between the two. If this
| 23865 | \see moveBelow, barBelow, barAbove |
| 23866 | */ |
| 23867 | void QCPBars::moveAbove(QCPBars *bars) |
| 23868 | { |
| 23869 | if (bars == this) return; |
| 23870 | if (bars && (bars->keyAxis() != mKeyAxis.data() || bars->valueAxis() != mValueAxis.data())) |
| 23871 | { |
| 23872 | qDebug() << Q_FUNC_INFO << "passed QCPBars* doesn't have same key and value axis as this QCPBars"; |
| 23873 | return; |
| 23874 | } |
| 23875 | // remove from stacking: |
| 23876 | connectBars(mBarBelow.data(), mBarAbove.data()); // Note: also works if one (or both) of them is 0 |
| 23877 | // if new bar given, insert this bar above it: |
| 23878 | if (bars) |
| 23879 | { |
| 23880 | if (bars->mBarAbove) |
| 23881 | connectBars(this, bars->mBarAbove.data()); |
| 23882 | connectBars(bars, this); |
| 23883 | } |
| 23884 | } |
| 23885 | |
| 23886 | /*! |
| 23887 | \copydoc QCPPlottableInterface1D::selectTestRect |