MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / removePlottable

Method removePlottable

qcustomplot/qcustomplot.cpp:13540–13557  ·  view source on GitHub ↗

! Removes the specified plottable from the plot and deletes it. If necessary, the corresponding legend item is also removed from the default legend (QCustomPlot::legend). Returns true on success. \see clearPlottables */

Source from the content-addressed store, hash-verified

13538 \see clearPlottables
13539*/
13540bool QCustomPlot::removePlottable(QCPAbstractPlottable *plottable)
13541{
13542 if (!mPlottables.contains(plottable))
13543 {
13544 qDebug() << Q_FUNC_INFO << "plottable not in list:" << reinterpret_cast<quintptr>(plottable);
13545 return false;
13546 }
13547
13548 // remove plottable from legend:
13549 plottable->removeFromLegend();
13550 // special handling for QCPGraphs to maintain the simple graph interface:
13551 if (QCPGraph *graph = qobject_cast<QCPGraph*>(plottable))
13552 mGraphs.removeOne(graph);
13553 // remove plottable:
13554 delete plottable;
13555 mPlottables.removeOne(plottable);
13556 return true;
13557}
13558
13559/*! \overload
13560

Callers

nothing calls this directly

Calls 3

containsMethod · 0.80
removeFromLegendMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected