From f69b1afbaba47404ddeaa88b5740b1a423b02427 Mon Sep 17 00:00:00 2001
From: Robert Applin <40830825+robertapplin@users.noreply.github.com>
Date: Fri, 23 Nov 2018 12:38:51 +0000
Subject: [PATCH] Refs #24086. Fix errors not updating

---
 .../Indirect/IndirectFitAnalysisTab.cpp        | 18 ++++++++++--------
 .../Indirect/IndirectFitPlotView.cpp           |  3 ++-
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp
index a2424312ff4..966f1c8e435 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp
@@ -114,10 +114,6 @@ void IndirectFitAnalysisTab::setup() {
           SLOT(updateResultOptions()));
   connect(m_fitPropertyBrowser, SIGNAL(functionChanged()), this,
           SLOT(updateParameterValues()));
-  connect(m_plotPresenter.get(), SIGNAL(selectedFitDataChanged(std::size_t)),
-          this, SLOT(updateParameterValues()));
-  connect(m_plotPresenter.get(), SIGNAL(plotSpectrumChanged(std::size_t)), this,
-          SLOT(updateParameterValues()));
 
   connect(m_plotPresenter.get(),
           SIGNAL(fitSingleSpectrum(std::size_t, std::size_t)), this,
@@ -183,14 +179,20 @@ void IndirectFitAnalysisTab::connectFitBrowserAndPlotPresenter() {
           SLOT(setBrowserWorkspaceIndex(std::size_t)));
   connect(m_plotPresenter.get(), SIGNAL(selectedFitDataChanged(std::size_t)),
           this, SLOT(setBrowserWorkspace(std::size_t)));
-  connect(m_plotPresenter.get(), SIGNAL(plotSpectrumChanged(std::size_t)), this,
-          SLOT(setBrowserWorkspaceIndex(std::size_t)));
   connect(m_fitPropertyBrowser, SIGNAL(functionChanged()), this,
           SLOT(updateAttributeValues()));
   connect(m_plotPresenter.get(), SIGNAL(selectedFitDataChanged(std::size_t)),
           this, SLOT(updateAttributeValues()));
-  connect(m_plotPresenter.get(), SIGNAL(plotSpectrumChanged(std::size_t)), this,
-          SLOT(updateAttributeValues()));
+	connect(m_plotPresenter.get(), SIGNAL(selectedFitDataChanged(std::size_t)),
+		      this, SLOT(updateParameterValues()));
+	connect(m_plotPresenter.get(), SIGNAL(plotSpectrumChanged(std::size_t)), this,
+		      SLOT(setBrowserWorkspaceIndex(std::size_t)));
+	// Update attributes before parameters as the parameters may depend on the 
+	// attribute values
+	connect(m_plotPresenter.get(), SIGNAL(plotSpectrumChanged(std::size_t)), this,
+		      SLOT(updateAttributeValues()));
+	connect(m_plotPresenter.get(), SIGNAL(plotSpectrumChanged(std::size_t)), this,
+		      SLOT(updateParameterValues()));
 
   connect(m_fitPropertyBrowser, SIGNAL(startXChanged(double)),
           m_plotPresenter.get(), SLOT(setStartX(double)));
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotView.cpp b/qt/scientific_interfaces/Indirect/IndirectFitPlotView.cpp
index e19a82fd2bb..b6efef16288 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotView.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotView.cpp
@@ -107,7 +107,8 @@ void IndirectFitPlotView::setMaximumSpectrum(int maximum) {
 }
 
 void IndirectFitPlotView::setPlotSpectrum(int spectrum) {
-  m_plotForm->spPlotSpectrum->setValue(spectrum);
+	//MantidQt::API::SignalBlocker<QObject> blocker(m_plotForm->spPlotSpectrum);
+  //m_plotForm->spPlotSpectrum->setValue(spectrum);
 }
 
 void IndirectFitPlotView::setBackgroundLevel(double value) {
-- 
GitLab