diff --git a/docs/source/release/v5.0.0/indirect_geometry.rst b/docs/source/release/v5.0.0/indirect_geometry.rst index 79318a8fc6600e98927f2d290124d43d31bd68c2..8e9033c2d3b9d4e2ff0c514b968ce9fba77a9a15 100644 --- a/docs/source/release/v5.0.0/indirect_geometry.rst +++ b/docs/source/release/v5.0.0/indirect_geometry.rst @@ -52,5 +52,6 @@ BugFixes - Fixed a bug crashing the ``Indirect ILL Data Reduction GUI`` when Run is clicked. - Indirect ILL reductions for BATS and Doppler QENS modes will now flag the outputs as distributions if the data is normalised by the monitor. - :ref:`IndirectILLReductionFWS <algm-IndirectILLReductionFWS>` will now allow for manual setting of the inelastic peak channels. +- The context menu on the fitting preview plots for Data Analysis has been temporarily disabled due to lack of communication between it and the interface causing bugs. :ref:`Release 5.0.0 <v5.0.0>` diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotView.cpp b/qt/scientific_interfaces/Indirect/IndirectFitPlotView.cpp index 8ba9a6a9546448b3ad9f0bfb2b8ed5c62b51fff9..eacae00ab1a3f30987ee5d1d5d9305055a6f8fef 100644 --- a/qt/scientific_interfaces/Indirect/IndirectFitPlotView.cpp +++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotView.cpp @@ -92,11 +92,13 @@ void IndirectFitPlotView::createSplitter() { PreviewPlot *IndirectFitPlotView::createTopPlot() { m_topPlot = std::make_unique<PreviewPlot>(m_splitter.get()); + m_topPlot->disableContextMenu(); return createPlot(m_topPlot.get(), QSize(0, 125), 0, 10); } PreviewPlot *IndirectFitPlotView::createBottomPlot() { m_bottomPlot = std::make_unique<PreviewPlot>(m_splitter.get()); + m_bottomPlot->disableContextMenu(); return createPlot(m_bottomPlot.get(), QSize(0, 75), 0, 6); } diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/PreviewPlot.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/PreviewPlot.h index aebe5701e3d6b836a537f59e50b04b1f5a1395f3..bb7a82ca2ff2d5c60e058801a7dad6fe488fa240 100644 --- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/PreviewPlot.h +++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/PreviewPlot.h @@ -89,6 +89,7 @@ public: void setAxisRange(const QPair<double, double> &range, AxisID axisID = AxisID::XBottom); std::tuple<double, double> getAxisRange(AxisID axisID = AxisID::XBottom); + void disableContextMenu(); public slots: void clear(); @@ -169,6 +170,7 @@ private: QAction *m_contextResetView; QActionGroup *m_contextXScale, *m_contextYScale; QAction *m_contextLegend; + bool m_context_enabled; }; } // namespace MantidWidgets diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PreviewPlot.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PreviewPlot.h index e93d689d8a0f9958cb68a24a6eabd2a442061c01..b32259ce1e005b68d4d93c5fe488ea9a5a77b545 100644 --- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PreviewPlot.h +++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PreviewPlot.h @@ -111,6 +111,7 @@ public: QString getAxisType(int axisID); void disableYAxisMenu(); + void disableContextMenu(); signals: /// Signals that the plot should be refreshed diff --git a/qt/widgets/plotting/src/Mpl/PreviewPlot.cpp b/qt/widgets/plotting/src/Mpl/PreviewPlot.cpp index e59ef07e918a776ae77bf1c1b923b7f0e0e90ec0..f6581efa3701ed5d0c905de36cb1af07b9701b25 100644 --- a/qt/widgets/plotting/src/Mpl/PreviewPlot.cpp +++ b/qt/widgets/plotting/src/Mpl/PreviewPlot.cpp @@ -62,6 +62,7 @@ PreviewPlot::PreviewPlot(QWidget *parent, bool observeADS) createActions(); m_selectorActive = false; + m_context_enabled = true; m_canvas->installEventFilterToMplCanvas(this); watchADS(observeADS); @@ -442,7 +443,9 @@ bool PreviewPlot::handleMouseReleaseEvent(QMouseEvent *evt) { bool stopEvent(false); if (evt->button() == Qt::RightButton) { stopEvent = true; - showContextMenu(evt); + if (m_context_enabled) { + showContextMenu(evt); + } } else if (evt->button() == Qt::LeftButton) { const auto position = evt->pos(); if (!position.isNull()) @@ -701,5 +704,14 @@ void PreviewPlot::toggleLegend(const bool checked) { this->replot(); } +void PreviewPlot::disableContextMenu() { + // Disable the context menu signal + // TODO Currently when changes are made to the plot through the context menu + // it is not communicated through to the perant gui which can cause issues, + // for now we are disabling the context menu but is should be made to + // communicate so it can be reactivated. + m_context_enabled = false; +} + } // namespace MantidWidgets } // namespace MantidQt diff --git a/qt/widgets/plotting/src/Qwt/PreviewPlot.cpp b/qt/widgets/plotting/src/Qwt/PreviewPlot.cpp index 134c884609ee3970e792ce6447d54c4ed01463fb..8933159ecd4b8aa3359c5533ac4935822bf74482 100644 --- a/qt/widgets/plotting/src/Qwt/PreviewPlot.cpp +++ b/qt/widgets/plotting/src/Qwt/PreviewPlot.cpp @@ -63,7 +63,6 @@ PreviewPlot::PreviewPlot(QWidget *parent, bool init) m_uiForm.plot->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_uiForm.plot, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); - // Create the plot tool list for context menu m_plotToolGroup = new QActionGroup(m_contextMenu); m_plotToolGroup->setExclusive(true); @@ -898,7 +897,6 @@ QStringList PreviewPlot::getCurvesForWorkspace(const MatrixWorkspace_sptr ws) { * @param position Position at which to show menu */ void PreviewPlot::showContextMenu(QPoint position) { - // Show the context menu m_contextMenu->popup(m_uiForm.plot->mapToGlobal(position)); } @@ -1012,3 +1010,13 @@ void PreviewPlot::disableYAxisMenu() { else menu->setVisible(false); } + +void PreviewPlot::disableContextMenu() { + // Disable the context menu signal + // TODO Currently when changes are made to the plot through the context menu + // it is not communicated through to the perant gui which can cause issues, + // for now we are disabling the context menu but is should be made to + // communicate so it can be reactivated. + disconnect(m_uiForm.plot, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(showContextMenu(QPoint))); +}