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

Method addFunctionCurve

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

Source from the content-addressed store, hash-verified

2103}
2104
2105void CartesianPlot::addFunctionCurve() {
2106 auto* curve = new XYFunctionCurve(i18n("Function"));
2107 const auto* curCurve = currentCurve();
2108 if (curCurve) {
2109 beginMacro(i18n("%1: add function of '%2'", name(), curCurve->name()));
2110 curve->setName(i18n("Function of '%1'", curCurve->name()));
2111 curve->setFunction(QString(), {QStringLiteral("x")}, {curCurve});
2112 } else
2113 beginMacro(i18n("%1: add function curve", name()));
2114
2115 this->addChild(curve);
2116 endMacro();
2117}
2118
2119/*!
2120 * public helper function to set a legend object created outside of CartesianPlot, e.g. in \c OriginProjectParser.

Callers

nothing calls this directly

Calls 5

setFunctionMethod · 0.80
QStringClass · 0.50
nameMethod · 0.45
setNameMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected