! \internal Adds the \a layerable to the list of this layer. If \a prepend is set to true, the layerable will be prepended to the list, i.e. be drawn beneath the other layerables already in the list. This function does not change the \a mLayer member of \a layerable to this layer. (Use QCPLayerable::setLayer to change the layer of an object, not this function.) \see removeChild
| 1196 | \see removeChild |
| 1197 | */ |
| 1198 | void QCPLayer::addChild(QCPLayerable *layerable, bool prepend) |
| 1199 | { |
| 1200 | if (!mChildren.contains(layerable)) |
| 1201 | { |
| 1202 | if (prepend) |
| 1203 | mChildren.prepend(layerable); |
| 1204 | else |
| 1205 | mChildren.append(layerable); |
| 1206 | if (!mPaintBuffer.isNull()) |
| 1207 | mPaintBuffer.data()->setInvalidated(); |
| 1208 | } else |
| 1209 | qDebug() << Q_FUNC_INFO << "layerable is already child of this layer" << reinterpret_cast<quintptr>(layerable); |
| 1210 | } |
| 1211 | |
| 1212 | /*! \internal |
| 1213 |
no test coverage detected