MCPcopy Create free account
hub / github.com/cutechess/cutechess / moveToLayer

Method moveToLayer

projects/gui/3rdparty/qcustomplot/qcustomplot.cpp:1567–1589  ·  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

1565 Returns true on success, i.e. if \a layer is a valid layer.
1566*/
1567bool QCPLayerable::moveToLayer(QCPLayer *layer, bool prepend)
1568{
1569 if (layer && !mParentPlot)
1570 {
1571 qDebug() << Q_FUNC_INFO << "no parent QCustomPlot set";
1572 return false;
1573 }
1574 if (layer && layer->parentPlot() != mParentPlot)
1575 {
1576 qDebug() << Q_FUNC_INFO << "layer" << layer->name() << "is not in same QCustomPlot as this layerable";
1577 return false;
1578 }
1579
1580 QCPLayer *oldLayer = mLayer;
1581 if (mLayer)
1582 mLayer->removeChild(this);
1583 mLayer = layer;
1584 if (mLayer)
1585 mLayer->addChild(this, prepend);
1586 if (mLayer != oldLayer)
1587 emit layerChanged(mLayer);
1588 return true;
1589}
1590
1591/*! \internal
1592

Callers 1

removeLayerMethod · 0.80

Calls 3

removeChildMethod · 0.80
nameMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected