##// END OF EJS Templates
Restored Zones edition, now we can move and resize zones again...
jeandet -
r1387:6dccdbafd078
parent child
Show More
@@ -892,6 +892,15 void VisualizationGraphWidget::mouseMoveEvent(QMouseEvent *event)
892 }
892 }
893 else if(sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::SelectionZones)
893 else if(sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::SelectionZones)
894 {
894 {
895 if(auto item = impl->m_plot->itemAt(event->pos()))
896 {
897 if(qobject_cast<VisualizationSelectionZoneItem*>(item))
898 {
899 QMouseEvent e{QEvent::MouseMove,this->impl->m_plot->mapFromParent(event->pos()),event->button(),event->buttons(),event->modifiers()};
900 sqpApp->sendEvent(this->impl->m_plot, &e);
901 this->impl->m_plot->replot(QCustomPlot::rpQueuedReplot);
902 }
903 }
895
904
896 }
905 }
897 }
906 }
@@ -921,6 +930,15 void VisualizationGraphWidget::mouseReleaseEvent(QMouseEvent *event)
921 {
930 {
922 setCursor(Qt::ArrowCursor);
931 setCursor(Qt::ArrowCursor);
923 }
932 }
933 auto posInPlot = this->impl->m_plot->mapFromParent(event->pos());
934 if(auto item = impl->m_plot->itemAt(posInPlot))
935 {
936 if(qobject_cast<VisualizationSelectionZoneItem*>(item))
937 {
938 QMouseEvent e{QEvent::MouseButtonRelease, posInPlot, event->button(), event->buttons(), event->modifiers()};
939 sqpApp->sendEvent(this->impl->m_plot, &e);
940 }
941 }
924 event->accept();
942 event->accept();
925 }
943 }
926
944
@@ -965,6 +983,17 void VisualizationGraphWidget::mousePressEvent(QMouseEvent *event)
965 parentVisualizationWidget()->selectionZoneManager().select({ selectedZone });
983 parentVisualizationWidget()->selectionZoneManager().select({ selectedZone });
966 }
984 }
967 }
985 }
986 {
987 auto posInPlot = this->impl->m_plot->mapFromParent(event->pos());
988 if(auto item = impl->m_plot->itemAt(posInPlot))
989 {
990 if(qobject_cast<VisualizationSelectionZoneItem*>(item))
991 {
992 QMouseEvent e{QEvent::MouseButtonPress, posInPlot, event->button(), event->buttons(), event->modifiers()};
993 sqpApp->sendEvent(this->impl->m_plot, &e);
994 }
995 }
996 }
968 break;
997 break;
969 case SqpApplication::PlotsInteractionMode::ZoomBox :
998 case SqpApplication::PlotsInteractionMode::ZoomBox :
970 impl->startDrawingRect(event->pos());
999 impl->startDrawingRect(event->pos());
General Comments 0
You need to be logged in to leave comments. Login now