MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / setGraph

Method setGraph

qcustomplot.cpp:29739–29755  ·  view source on GitHub ↗

! Sets the QCPGraph this tracer sticks to. The tracer \a position will be set to type QCPItemPosition::ptPlotCoords and the axes will be set to the axes of \a graph. To free the tracer from any graph, set \a graph to 0. The tracer \a position can then be placed freely like any other item position. This is the state the tracer will assume when its graph gets deleted while still attache

Source from the content-addressed store, hash-verified

29737 \see setGraphKey
29738*/
29739void QCPItemTracer::setGraph(QCPGraph *graph)
29740{
29741 if (graph)
29742 {
29743 if (graph->parentPlot() == mParentPlot)
29744 {
29745 position->setType(QCPItemPosition::ptPlotCoords);
29746 position->setAxes(graph->keyAxis(), graph->valueAxis());
29747 mGraph = graph;
29748 updatePosition();
29749 } else
29750 qDebug() << Q_FUNC_INFO << "graph isn't in same QCustomPlot instance as this item";
29751 } else
29752 {
29753 mGraph = 0;
29754 }
29755}
29756
29757/*!
29758 Sets the key of the graph's data point the tracer will be positioned at. This is the only free

Callers 1

plottableDoubleClickMethod · 0.80

Calls 2

setTypeMethod · 0.80
setAxesMethod · 0.80

Tested by

no test coverage detected