! Inserts the specified \a bars plottable into this group at the specified index position \a i. This gives you full control over the ordering of the bars. \a bars may already be part of this group. In that case, \a bars is just moved to the new index position. \see append, remove */
| 24121 | \see append, remove |
| 24122 | */ |
| 24123 | void QCPBarsGroup::insert(int i, QCPBars *bars) |
| 24124 | { |
| 24125 | if (!bars) |
| 24126 | { |
| 24127 | qDebug() << Q_FUNC_INFO << "bars is 0"; |
| 24128 | return; |
| 24129 | } |
| 24130 | |
| 24131 | // first append to bars list normally: |
| 24132 | if (!mBars.contains(bars)) |
| 24133 | bars->setBarsGroup(this); |
| 24134 | // then move to according position: |
| 24135 | mBars.move(mBars.indexOf(bars), qBound(0, i, mBars.size()-1)); |
| 24136 | } |
| 24137 | |
| 24138 | /*! |
| 24139 | Removes the specified \a bars plottable from this group. |