Commit 17e6df25 authored by Robert Applin's avatar Robert Applin
Browse files

Refs #28842. Add update estimate button.

parent f0e56174
......@@ -63,6 +63,7 @@ public:
public slots:
void doFit();
void updateEstimate();
protected:
void setupPlotFitSplitter(const double &start, const double &end) override;
......@@ -74,6 +75,7 @@ private:
QLineEdit *m_start, *m_end;
QSplitter *m_fitPlotLayout;
QPushButton *m_fitButton;
QPushButton *m_updateEstimateButton;
Observable *m_fitObservable;
};
} // namespace MantidWidgets
......
......@@ -50,12 +50,16 @@ QWidget *PlotFitAnalysisPaneView::createFitPane(const double &start,
auto fitButtons = new QWidget();
auto layout = new QHBoxLayout(fitButtons);
m_fitButton = new QPushButton("Fit");
m_updateEstimateButton = new QPushButton("Update Estimate");
m_fitObservable = new Observable();
connect(m_fitButton, SIGNAL(clicked()), this, SLOT(doFit()));
connect(m_updateEstimateButton, SIGNAL(clicked()), this,
SLOT(updateEstimate()));
layout->addWidget(m_fitButton);
layout->addItem(
new QSpacerItem(80, 0, QSizePolicy::Expanding, QSizePolicy::Fixed));
layout->addWidget(m_updateEstimateButton);
fitPaneLayout->addWidget(fitButtons);
......@@ -88,6 +92,13 @@ void PlotFitAnalysisPaneView::doFit() {
}
}
void PlotFitAnalysisPaneView::updateEstimate() {
auto function = m_fitBrowser->getFunction();
if (function) {
m_fitObservable->notify();
}
}
void PlotFitAnalysisPaneView::addSpectrum(const std::string &wsName) {
m_plot->addSpectrum("Extracted Data", wsName.c_str(), 0, Qt::black);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment