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

Method setScales

src/backend/worksheet/plots/cartesian/CartesianCoordinateSystem.cpp:690–709  ·  view source on GitHub ↗

TODO: design elegant, flexible and undo-aware API for changing scales

Source from the content-addressed store, hash-verified

688
689// TODO: design elegant, flexible and undo-aware API for changing scales
690bool CartesianCoordinateSystem::setScales(const Dimension dim, const QVector<CartesianScale*>& scales) {
691 DEBUG(Q_FUNC_INFO)
692 switch (dim) {
693 case Dimension::X: {
694 while (!d->xScales.isEmpty())
695 delete d->xScales.takeFirst();
696
697 d->xScales = scales;
698 return true; // TODO: check scales validity
699 }
700 case Dimension::Y: {
701 while (!d->yScales.isEmpty())
702 delete d->yScales.takeFirst();
703
704 d->yScales = scales;
705 return true; // TODO: check scales validity
706 }
707 }
708 return 1;
709}
710
711QVector<CartesianScale*> CartesianCoordinateSystem::scales(const Dimension dim) const {
712 DEBUG(Q_FUNC_INFO)

Callers 1

retransformScaleMethod · 0.80

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected