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

Method setCursor0Enable

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

Source from the content-addressed store, hash-verified

1722// cursor
1723STD_SETTER_CMD_IMPL_F_S(CartesianPlot, SetCursor0Enable, bool, cursor0Enable, updateCursor)
1724void 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
1735STD_SETTER_CMD_IMPL_F_S(CartesianPlot, SetCursor1Enable, bool, cursor1Enable, updateCursor)
1736void CartesianPlot::setCursor1Enable(const bool& enable) {

Callers 1

cursor0EnableChangedMethod · 0.80

Calls 5

xMethod · 0.80
setXMethod · 0.80
QPointFClass · 0.70
isValidMethod · 0.45
mapSceneToLogicalMethod · 0.45

Tested by

no test coverage detected