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

Method enableAutoScale

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

set auto scale for x/y range index (index == -1: all ranges)

Source from the content-addressed store, hash-verified

1334
1335// set auto scale for x/y range index (index == -1: all ranges)
1336void CartesianPlot::enableAutoScale(const Dimension dim, int index, const bool enable, bool fullRange) {
1337 PERFTRACE(QLatin1String(Q_FUNC_INFO));
1338 Q_D(CartesianPlot);
1339 if (index < -1 || index >= rangeCount(dim)) {
1340 DEBUG(Q_FUNC_INFO << QStringLiteral("Warning: Invalid index: ").arg(index).toStdString());
1341 return;
1342 }
1343
1344 if (index == -1) { // all x ranges
1345 for (int i = 0; i < rangeCount(dim); i++)
1346 enableAutoScale(dim, i, enable, fullRange);
1347 return;
1348 }
1349
1350 if (enable != range(dim, index).autoScale()) {
1351 DEBUG(Q_FUNC_INFO << ", x range " << index << " enable auto scale: " << enable)
1352 // TODO: maybe using the first and then adding the first one as parent to the next undo command
1353 exec(new CartesianPlotEnableAutoScaleIndexCmd(d, dim, enable, index, fullRange));
1354 setProjectChanged(true);
1355 }
1356}
1357
1358int CartesianPlot::rangeCount(const Dimension dim) const {
1359 Q_D(const CartesianPlot);

Callers 15

autoScaleRangeMethod · 0.45
showParetoPlotMethod · 0.45
redoMethod · 0.45
undoMethod · 0.45
translateRangeMethod · 0.45
autoScaleLog10Method · 0.45
autoScaleLog102Method · 0.45

Calls 3

toStdStringMethod · 0.80
argMethod · 0.80
autoScaleMethod · 0.45