| 202 | } |
| 203 | |
| 204 | void CursorController::syncXCursorControllers(CursorController *ctrl1, CursorController *ctrl2) |
| 205 | { |
| 206 | ctrl2->setVisible(ctrl1->isVisible()); |
| 207 | ctrl2->x1Cursor->setPosition(ctrl1->x1Cursor->getPosition()); |
| 208 | ctrl2->x2Cursor->setPosition(ctrl1->x2Cursor->getPosition()); |
| 209 | |
| 210 | // connect ctrl1 to ctrl2 |
| 211 | connect(ctrl1->x1Cursor, &PlotAxisHandle::scalePosChanged, ctrl2->x1Cursor, [=](double pos) { |
| 212 | ctrl1->x1Cursor->blockSignals(true); |
| 213 | ctrl2->x1Cursor->setPosition(pos); |
| 214 | ctrl1->x1Cursor->blockSignals(false); |
| 215 | ctrl2->m_plot->repaint(); |
| 216 | }); |
| 217 | connect(ctrl1->x2Cursor, &PlotAxisHandle::scalePosChanged, ctrl2->x2Cursor, [=](double pos) { |
| 218 | ctrl1->x2Cursor->blockSignals(true); |
| 219 | ctrl2->x2Cursor->setPosition(pos); |
| 220 | ctrl1->x2Cursor->blockSignals(false); |
| 221 | ctrl2->m_plot->repaint(); |
| 222 | }); |
| 223 | |
| 224 | // connect ctrl2 to ctrl1 |
| 225 | connect(ctrl2->x1Cursor, &PlotAxisHandle::scalePosChanged, ctrl1->x1Cursor, [=](double pos) { |
| 226 | ctrl2->x1Cursor->blockSignals(true); |
| 227 | ctrl1->x1Cursor->setPosition(pos); |
| 228 | ctrl2->x1Cursor->blockSignals(false); |
| 229 | ctrl1->m_plot->repaint(); |
| 230 | }); |
| 231 | connect(ctrl2->x2Cursor, &PlotAxisHandle::scalePosChanged, ctrl1->x2Cursor, [=](double pos) { |
| 232 | ctrl2->x2Cursor->blockSignals(true); |
| 233 | ctrl1->x2Cursor->setPosition(pos); |
| 234 | ctrl2->x2Cursor->blockSignals(false); |
| 235 | ctrl1->m_plot->repaint(); |
| 236 | }); |
| 237 | } |
| 238 | |
| 239 | void CursorController::unsyncXCursorControllers(CursorController *ctrl1, CursorController *ctrl2) |
| 240 | { |
nothing calls this directly
no test coverage detected