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

Method createPosition

src/qt/qcustomplot.cpp:12462–12475  ·  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

12460 \see createAnchor
12461*/
12462QCPItemPosition *QCPAbstractItem::createPosition(const QString &name)
12463{
12464 if (hasAnchor(name))
12465 qDebug() << Q_FUNC_INFO << "anchor/position with name exists already:" << name;
12466 QCPItemPosition *newPosition = new QCPItemPosition(mParentPlot, this, name);
12467 mPositions.append(newPosition);
12468 mAnchors.append(newPosition); // every position is also an anchor
12469 newPosition->setAxes(mParentPlot->xAxis, mParentPlot->yAxis);
12470 newPosition->setType(QCPItemPosition::ptPlotCoords);
12471 if (mParentPlot->axisRect())
12472 newPosition->setAxisRect(mParentPlot->axisRect());
12473 newPosition->setCoords(0, 0);
12474 return newPosition;
12475}
12476
12477/*! \internal
12478

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected