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

Method setCartesianPlotCursorMode

src/backend/worksheet/Worksheet.cpp:603–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601}
602
603void Worksheet::setCartesianPlotCursorMode(Worksheet::CartesianPlotActionMode mode) {
604 Q_D(Worksheet);
605 if (d->cartesianPlotCursorMode == mode)
606 return;
607
608 d->cartesianPlotCursorMode = mode;
609
610 if (mode == CartesianPlotActionMode::ApplyActionToAll) {
611 d->suppressCursorPosChanged = true;
612 const auto& plots = children<CartesianPlot>();
613 QPointF logicPos;
614 if (!plots.isEmpty()) {
615 for (int i = 0; i < 2; i++) {
616 logicPos = QPointF(plots[0]->cursorPos(i), 0); // y value does not matter
617 cartesianPlotMousePressCursorMode(i, logicPos);
618 }
619 }
620 d->suppressCursorPosChanged = false;
621 }
622 updateCompleteCursorTreeModel();
623 setProjectChanged(true);
624}
625
626void Worksheet::setInteractive(bool value) {
627 if (!m_view)

Callers

nothing calls this directly

Calls 3

cursorPosMethod · 0.80
QPointFClass · 0.50
isEmptyMethod · 0.45

Tested by

no test coverage detected