MCPcopy Create free account
hub / github.com/KDE/labplot / addCustomPoint

Method addCustomPoint

src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:2197–2220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2195}
2196
2197void CartesianPlot::addCustomPoint() {
2198 Q_D(CartesianPlot);
2199 auto* point = new CustomPoint(this, i18n("Custom Point"));
2200 point->setCoordinateSystemIndex(defaultCoordinateSystemIndex());
2201
2202 beginMacro(i18n("%1: add %2", name(), point->name()));
2203
2204 // must be before setting the position
2205 this->addChild(point);
2206
2207 if (d->calledFromContextMenu) {
2208 point->setCoordinateBindingEnabled(true);
2209 point->setPositionLogical(d->logicalPos);
2210 d->calledFromContextMenu = false;
2211 } else {
2212 auto p = point->position();
2213 p.point = QPointF(0, 0); // Exactly in the middle of the plot in scene coordinates
2214 point->setPosition(p);
2215 point->setCoordinateBindingEnabled(true);
2216 }
2217
2218 endMacro();
2219 point->retransform();
2220}
2221
2222void CartesianPlot::addReferenceLine() {
2223 Q_D(CartesianPlot);

Callers 1

keyPressEventMethod · 0.80

Calls 9

positionMethod · 0.80
QPointFClass · 0.70
nameMethod · 0.45
addChildMethod · 0.45
setPositionLogicalMethod · 0.45
setPositionMethod · 0.45
retransformMethod · 0.45

Tested by

no test coverage detected