| 1722 | // cursor |
| 1723 | STD_SETTER_CMD_IMPL_F_S(CartesianPlot, SetCursor0Enable, bool, cursor0Enable, updateCursor) |
| 1724 | void CartesianPlot::setCursor0Enable(const bool& enable) { |
| 1725 | Q_D(CartesianPlot); |
| 1726 | if (enable != d->cursor0Enable && defaultCoordinateSystem()->isValid()) { |
| 1727 | if (std::isnan(d->cursor0Pos.x())) { // if never set, set initial position |
| 1728 | d->cursor0Pos.setX(defaultCoordinateSystem()->mapSceneToLogical(QPointF(0, 0)).x()); |
| 1729 | mousePressCursorModeSignal(0, d->cursor0Pos); // simulate mousePress to update values in the cursor dock |
| 1730 | } |
| 1731 | exec(new CartesianPlotSetCursor0EnableCmd(d, enable, ki18n("%1: Cursor0 enable"))); |
| 1732 | } |
| 1733 | } |
| 1734 | |
| 1735 | STD_SETTER_CMD_IMPL_F_S(CartesianPlot, SetCursor1Enable, bool, cursor1Enable, updateCursor) |
| 1736 | void CartesianPlot::setCursor1Enable(const bool& enable) { |
no test coverage detected