From 2ebd4d48610306750708ba4edf12c9f7e0834d8e Mon Sep 17 00:00:00 2001 From: Applin Date: Tue, 7 May 2024 16:08:53 +0100 Subject: [PATCH] Fix non-virtual destructor and other warnings --- .../Inelastic/QENSFitting/FitPlotModel.cpp | 2 -- .../Inelastic/QENSFitting/FitPlotModel.h | 5 +++-- .../Inelastic/QENSFitting/FittingModel.cpp | 5 +++-- .../Inelastic/QENSFitting/FittingModel.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.cpp b/qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.cpp index f98f38efe94e..16ac81676bcc 100644 --- a/qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.cpp +++ b/qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.cpp @@ -87,8 +87,6 @@ FitPlotModel::FitPlotModel(std::vector *fittingData, IFitOutput *fitOut : m_fittingData(fittingData), m_fitOutput(fitOutput), m_activeWorkspaceID{0}, m_activeWorkspaceIndex{0}, m_activeFunction() {} -FitPlotModel::~FitPlotModel() {} - void FitPlotModel::setActiveIndex(WorkspaceID workspaceID) { m_activeWorkspaceID = workspaceID; } void FitPlotModel::setActiveSpectrum(WorkspaceIndex spectrum) { m_activeWorkspaceIndex = spectrum; } diff --git a/qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.h b/qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.h index 9d0642af5d9e..a39c2ee7e080 100644 --- a/qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.h +++ b/qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.h @@ -25,6 +25,8 @@ using namespace MantidWidgets; class MANTIDQT_INELASTIC_DLL IFitPlotModel { public: + virtual ~IFitPlotModel() = default; + virtual Mantid::API::MatrixWorkspace_sptr getWorkspace() const = 0; virtual Mantid::API::MatrixWorkspace_sptr getResultWorkspace() const = 0; virtual Mantid::API::MatrixWorkspace_sptr getGuessWorkspace() const = 0; @@ -50,10 +52,9 @@ class MANTIDQT_INELASTIC_DLL IFitPlotModel { virtual void setFitFunction(Mantid::API::MultiDomainFunction_sptr function) = 0; }; -class MANTIDQT_INELASTIC_DLL FitPlotModel : public IFitPlotModel { +class MANTIDQT_INELASTIC_DLL FitPlotModel final : public IFitPlotModel { public: FitPlotModel(std::vector *fittingData, IFitOutput *fitOutput); - ~FitPlotModel(); Mantid::API::MatrixWorkspace_sptr getWorkspace() const override; Mantid::API::MatrixWorkspace_sptr getResultWorkspace() const override; diff --git a/qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.cpp b/qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.cpp index 3ef307c7e81e..9a26f073828e 100644 --- a/qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.cpp +++ b/qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.cpp @@ -308,8 +308,9 @@ std::unordered_map fitModeToName = std::unordered_map< {{FittingMode::SEQUENTIAL, "Seq"}, {FittingMode::SIMULTANEOUS, "Sim"}}); FittingModel::FittingModel() - : m_fitDataModel(std::make_unique()), m_fitPlotModel(), m_fitOutput(std::make_unique()), - m_previousModelSelected(false), m_fittingMode(FittingMode::SEQUENTIAL) { + : m_fitType("FitType"), m_fitString("FitString"), m_fitDataModel(std::make_unique()), + m_fitPlotModel(), m_previousModelSelected(false), m_fittingMode(FittingMode::SEQUENTIAL), + m_fitOutput(std::make_unique()), m_activeFunction(), m_fitFunction(), m_defaultParameters() { m_fitPlotModel = std::make_unique(m_fitDataModel->getFittingData(), m_fitOutput.get()); } diff --git a/qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.h b/qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.h index 7197f5940aaf..c6d5bb706055 100644 --- a/qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.h +++ b/qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.h @@ -104,8 +104,8 @@ class MANTIDQT_INELASTIC_DLL FittingModel : public IFittingModel { Mantid::API::IAlgorithm_sptr createSimultaneousFit(const Mantid::API::MultiDomainFunction_sptr &function) const; virtual Mantid::API::MultiDomainFunction_sptr getMultiDomainFunction() const; virtual std::unordered_map mapDefaultParameterNames() const; - std::string m_fitType = "FitType"; - std::string m_fitString = "FitString"; + std::string m_fitType; + std::string m_fitString; std::unique_ptr m_fitDataModel; std::unique_ptr m_fitPlotModel;