@@ -749,11 +749,12 void VisualizationGraphWidget::onMouseWheel(QWheelEvent *event) noexcept | |||||
749 |
|
749 | |||
750 | void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept |
|
750 | void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept | |
751 | { |
|
751 | { | |
752 |
|
|
752 | auto isDragDropClick = event->modifiers().testFlag(DRAG_DROP_MODIFIER); | |
753 | auto isSelectionZoneMode |
|
753 | auto isSelectionZoneMode | |
754 | = sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::SelectionZones; |
|
754 | = sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::SelectionZones; | |
|
755 | auto isLeftClick = event->buttons().testFlag(Qt::LeftButton); | |||
755 |
|
756 | |||
756 | if (!isDragDropClick) { |
|
757 | if (!isDragDropClick && isLeftClick) { | |
757 | if (sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::ZoomBox) { |
|
758 | if (sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::ZoomBox) { | |
758 | // Starts a zoom box |
|
759 | // Starts a zoom box | |
759 | impl->startDrawingRect(event->pos(), plot()); |
|
760 | impl->startDrawingRect(event->pos(), plot()); | |
@@ -766,9 +767,6 void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept | |||||
766 | } |
|
767 | } | |
767 | } |
|
768 | } | |
768 | } |
|
769 | } | |
769 | else if (sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::None) { |
|
|||
770 | plot().setInteraction(QCP::iRangeDrag, true); |
|
|||
771 | } |
|
|||
772 |
|
770 | |||
773 | // Allows mouse panning only in default mode |
|
771 | // Allows mouse panning only in default mode | |
774 | plot().setInteraction(QCP::iRangeDrag, sqpApp->plotsInteractionMode() |
|
772 | plot().setInteraction(QCP::iRangeDrag, sqpApp->plotsInteractionMode() | |
@@ -782,11 +780,11 void VisualizationGraphWidget::onMousePress(QMouseEvent *event) noexcept | |||||
782 | if (isSelectionZoneMode) { |
|
780 | if (isSelectionZoneMode) { | |
783 | auto isMultiSelectionClick = event->modifiers().testFlag(MULTI_ZONE_SELECTION_MODIFIER); |
|
781 | auto isMultiSelectionClick = event->modifiers().testFlag(MULTI_ZONE_SELECTION_MODIFIER); | |
784 | auto selectionZoneItemUnderCursor = impl->selectionZoneAt(event->pos(), plot()); |
|
782 | auto selectionZoneItemUnderCursor = impl->selectionZoneAt(event->pos(), plot()); | |
785 |
if (selectionZoneItemUnderCursor && |
|
783 | if (selectionZoneItemUnderCursor && isLeftClick) { | |
786 | selectionZoneItemUnderCursor->setAssociatedEditedZones( |
|
784 | selectionZoneItemUnderCursor->setAssociatedEditedZones( | |
787 | parentVisualizationWidget()->selectionZoneManager().selectedItems()); |
|
785 | parentVisualizationWidget()->selectionZoneManager().selectedItems()); | |
788 | } |
|
786 | } | |
789 |
else if (!isMultiSelectionClick && |
|
787 | else if (!isMultiSelectionClick && isLeftClick) { | |
790 | parentVisualizationWidget()->selectionZoneManager().clearSelection(); |
|
788 | parentVisualizationWidget()->selectionZoneManager().clearSelection(); | |
791 | } |
|
789 | } | |
792 | else { |
|
790 | else { |
General Comments 0
You need to be logged in to leave comments.
Login now