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

Method createPosition

qcustomplot.cpp:12473–12486  ·  view source on GitHub ↗

! \internal Creates a QCPItemPosition, registers it with this item and returns a pointer to it. The specified \a name must be a unique string that is usually identical to the variable name of the position member (This is needed to provide the name-based \ref position access to positions). Don't delete positions created by this function manually, as the item will take care of it. U

Source from the content-addressed store, hash-verified

12471 \see createAnchor
12472*/
12473QCPItemPosition *QCPAbstractItem::createPosition(const QString &name)
12474{
12475 if (hasAnchor(name))
12476 qDebug() << Q_FUNC_INFO << "anchor/position with name exists already:" << name;
12477 QCPItemPosition *newPosition = new QCPItemPosition(mParentPlot, this, name);
12478 mPositions.append(newPosition);
12479 mAnchors.append(newPosition); // every position is also an anchor
12480 newPosition->setAxes(mParentPlot->xAxis, mParentPlot->yAxis);
12481 newPosition->setType(QCPItemPosition::ptPlotCoords);
12482 if (mParentPlot->axisRect())
12483 newPosition->setAxisRect(mParentPlot->axisRect());
12484 newPosition->setCoords(0, 0);
12485 return newPosition;
12486}
12487
12488/*! \internal
12489

Callers

nothing calls this directly

Calls 6

appendMethod · 0.80
setAxesMethod · 0.80
setTypeMethod · 0.80
axisRectMethod · 0.80
setAxisRectMethod · 0.80
setCoordsMethod · 0.80

Tested by

no test coverage detected