############################################################################## #################################### SLOTs ############################### ##############################################################################
| 600 | // #################################### SLOTs ############################### |
| 601 | // ############################################################################## |
| 602 | void DatapickerImageView::mouseModeChanged(QAction* action) { |
| 603 | const auto mode = (DatapickerImageView::MouseMode)action->data().toInt(); |
| 604 | |
| 605 | if (action == navigationModeAction) { |
| 606 | setInteractive(false); |
| 607 | setDragMode(QGraphicsView::ScrollHandDrag); |
| 608 | m_image->setSegmentsHoverEvent(false); |
| 609 | } else if (action == zoomSelectionModeAction) { |
| 610 | setInteractive(false); |
| 611 | setDragMode(QGraphicsView::NoDrag); |
| 612 | m_image->setSegmentsHoverEvent(false); |
| 613 | setCursor(Qt::ArrowCursor); |
| 614 | } else { |
| 615 | setInteractive(true); |
| 616 | setDragMode(QGraphicsView::NoDrag); |
| 617 | m_image->setSegmentsHoverEvent(true); |
| 618 | setCursor(Qt::CrossCursor); |
| 619 | if (currentPlotPointsTypeAction != action) { |
| 620 | switch (m_mouseMode) { |
| 621 | case DatapickerImageView::MouseMode::ReferencePointsEntry: { |
| 622 | int count = m_image->childCount<DatapickerPoint>(AbstractAspect::ChildIndexFlag::IncludeHidden); |
| 623 | if (count) { |
| 624 | auto button = QMessageBox::question(this, |
| 625 | i18n("Remove existing reference points?"), |
| 626 | i18n("All available reference points will be removed. Do you want to continue?")); |
| 627 | if (button != QMessageBox::Yes) { |
| 628 | // Reset back to the old one |
| 629 | currentPlotPointsTypeAction->setChecked(true); |
| 630 | return; |
| 631 | } |
| 632 | } |
| 633 | |
| 634 | m_image->setPlotPointsType(DatapickerImage::PointsType::AxisPoints); |
| 635 | break; |
| 636 | } |
| 637 | case DatapickerImageView::MouseMode::CurvePointsEntry: |
| 638 | m_image->setPlotPointsType(DatapickerImage::PointsType::CurvePoints); |
| 639 | break; |
| 640 | case DatapickerImageView::MouseMode::CurveSegmentsEntry: |
| 641 | m_image->setPlotPointsType(DatapickerImage::PointsType::SegmentPoints); |
| 642 | break; |
| 643 | } |
| 644 | } |
| 645 | } |
| 646 | currentPlotPointsTypeAction = action; |
| 647 | m_mouseMode = mode; |
| 648 | } |
| 649 | |
| 650 | void DatapickerImageView::changeZoom(QAction* action) { |
| 651 | if (action == zoomInViewAction) |
nothing calls this directly
no test coverage detected