From 9c0cd97f56a71e249611e3eee37f7c5ef49715db 2020-01-10 12:47:16 From: Alexis Jeandet Date: 2020-01-10 12:47:16 Subject: [PATCH] fixed lost plot D&D Signed-off-by: Alexis Jeandet --- diff --git a/gui/src/Visualization/VisualizationGraphWidget.cpp b/gui/src/Visualization/VisualizationGraphWidget.cpp index 0426a3a..a68f8fd 100644 --- a/gui/src/Visualization/VisualizationGraphWidget.cpp +++ b/gui/src/Visualization/VisualizationGraphWidget.cpp @@ -949,7 +949,7 @@ void VisualizationGraphWidget::mouseMoveEvent(QMouseEvent* event) impl->m_RenderingDelegate->updateTooltip(event); } // event->accept(); - QWidget::mouseMoveEvent(event); + VisualizationDragWidget::mouseMoveEvent(event); } void VisualizationGraphWidget::mouseReleaseEvent(QMouseEvent* event) @@ -1061,7 +1061,7 @@ void VisualizationGraphWidget::mousePressEvent(QMouseEvent* event) } } // event->accept(); - QWidget::mousePressEvent(event); + VisualizationDragWidget::mousePressEvent(event); } void VisualizationGraphWidget::mouseDoubleClickEvent(QMouseEvent* event) diff --git a/gui/src/Visualization/VisualizationZoneWidget.cpp b/gui/src/Visualization/VisualizationZoneWidget.cpp index b7f407c..d0d3a87 100644 --- a/gui/src/Visualization/VisualizationZoneWidget.cpp +++ b/gui/src/Visualization/VisualizationZoneWidget.cpp @@ -220,66 +220,6 @@ VisualizationGraphWidget* VisualizationZoneWidget::createGraph( graphWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); graphWidget->setMinimumHeight(GRAPH_MINIMUM_HEIGHT); - - // Lambda to synchronize zone widget - // auto synchronizeZoneWidget = [this, graphWidget](const DateTimeRange &graphRange, - // const DateTimeRange &oldGraphRange) { - - // auto zoomType = DateTimeRangeHelper::getTransformationType(oldGraphRange, graphRange); - // auto frameLayout = ui->dragDropContainer->layout(); - // for (auto i = 0; i < frameLayout->count(); ++i) { - // auto graphChild - // = dynamic_cast(frameLayout->itemAt(i)->widget()); - // if (graphChild && (graphChild != graphWidget)) { - - // auto graphChildRange = graphChild->graphRange(); - // switch (zoomType) { - // case TransformationType::ZoomIn: { - // auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart; - // auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd; - // graphChildRange.m_TStart += deltaLeft; - // graphChildRange.m_TEnd -= deltaRight; - // break; - // } - - // case TransformationType::ZoomOut: { - // auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart; - // auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd; - // graphChildRange.m_TStart -= deltaLeft; - // graphChildRange.m_TEnd += deltaRight; - // break; - // } - // case TransformationType::PanRight: { - // auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart; - // auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd; - // graphChildRange.m_TStart += deltaLeft; - // graphChildRange.m_TEnd += deltaRight; - // break; - // } - // case TransformationType::PanLeft: { - // auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart; - // auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd; - // graphChildRange.m_TStart -= deltaLeft; - // graphChildRange.m_TEnd -= deltaRight; - // break; - // } - // case TransformationType::Unknown: { - // break; - // } - // default: - // qCCritical(LOG_VisualizationZoneWidget()) - // << tr("Impossible to synchronize: zoom type not take into - // account"); - // // No action - // break; - // } - // graphChild->setFlags(GraphFlag::DisableAll); - // graphChild->setGraphRange(graphChildRange, true); - // graphChild->setFlags(GraphFlag::EnableAll); - // } - // } - // }; - // connection for synchronization // connect(graphWidget, &VisualizationGraphWidget::synchronize, synchronizeZoneWidget); connect(graphWidget, &VisualizationGraphWidget::variableAdded, this,