MCPcopy Create free account
hub / github.com/LUX-Core/lux / moveToLayer

Method moveToLayer

src/qt/qcustomplot.cpp:1535–1557  ·  view source on GitHub ↗

! \internal Moves this layerable object to \a layer. If \a prepend is true, this object will be prepended to the new layer's list, i.e. it will be drawn below the objects already on the layer. If it is false, the object will be appended. Returns true on success, i.e. if \a layer is a valid layer. */

Source from the content-addressed store, hash-verified

1533 Returns true on success, i.e. if \a layer is a valid layer.
1534*/
1535bool QCPLayerable::moveToLayer(QCPLayer *layer, bool prepend)
1536{
1537 if (layer && !mParentPlot)
1538 {
1539 qDebug() << Q_FUNC_INFO << "no parent QCustomPlot set";
1540 return false;
1541 }
1542 if (layer && layer->parentPlot() != mParentPlot)
1543 {
1544 qDebug() << Q_FUNC_INFO << "layer" << layer->name() << "is not in same QCustomPlot as this layerable";
1545 return false;
1546 }
1547
1548 QCPLayer *oldLayer = mLayer;
1549 if (mLayer)
1550 mLayer->removeChild(this);
1551 mLayer = layer;
1552 if (mLayer)
1553 mLayer->addChild(this, prepend);
1554 if (mLayer != oldLayer)
1555 Q_EMIT layerChanged(mLayer);
1556 return true;
1557}
1558
1559/*! \internal
1560

Callers 1

removeLayerMethod · 0.80

Calls 3

removeChildMethod · 0.80
addChildMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected