Commit cbbc49fc authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Find most cases of -Wsuggest-override in MantidPlot.

parent 08ea4369
......@@ -41,15 +41,15 @@ public:
/// Default constructor
explicit MantidCurve(bool err);
/// Destructor
virtual ~MantidCurve();
~MantidCurve() override;
/// Clone
virtual MantidCurve* clone(const Graph* g) const = 0;
MantidCurve *clone(const Graph *g) const override = 0;
/// Get mantid data
virtual const MantidQwtWorkspaceData* mantidData() const = 0;
/// Get mantid data
virtual MantidQwtWorkspaceData* mantidData() = 0;
/// Overriden virtual method
void itemChanged();
void itemChanged() override;
/// Returns whether the curve has error bars
bool hasErrorBars() const
......@@ -58,7 +58,7 @@ public:
}
/// Returns the error bar settings for this curve (a MantidCurve has only one set of error bars)
virtual QList<ErrorBarSettings*> errorBarSettingsList() const;
QList<ErrorBarSettings *> errorBarSettingsList() const override;
/// Invalidates the bounding rect forcing it to be recalculated
void invalidateBoundingRect(){m_boundingRect = QwtDoubleRect();}
......@@ -67,7 +67,7 @@ public:
Public Base/Common methods
-------------------------------------------------------------------------------------*/
QwtDoubleRect boundingRect() const;
QwtDoubleRect boundingRect() const override;
/*-------------------------------------------------------------------------------------
End Public Base/Common methods
......
......@@ -53,10 +53,10 @@ class MantidDockWidget: public QDockWidget
Q_OBJECT
public:
MantidDockWidget(MantidUI *mui, ApplicationWindow *parent);
~MantidDockWidget();
~MantidDockWidget() override;
QString getSelectedWorkspaceName() const;
Mantid::API::Workspace_sptr getSelectedWorkspace() const;
void dropEvent(QDropEvent *de);
void dropEvent(QDropEvent *de) override;
public slots:
void clickedWorkspace(QTreeWidgetItem*, int);
......@@ -163,9 +163,9 @@ class MantidTreeWidget:public QTreeWidget
public:
MantidTreeWidget(MantidDockWidget *w, MantidUI *mui);
void mousePressEvent (QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *e);
void mouseDoubleClickEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e) override;
void mouseMoveEvent(QMouseEvent *e) override;
void mouseDoubleClickEvent(QMouseEvent *e) override;
QStringList getSelectedWorkspaceNames() const;
MantidWSIndexWidget::UserInput
......@@ -178,7 +178,7 @@ public:
void logWarningMessage(const std::string&);
void disableNodes(bool);
void sort();
void dropEvent(QDropEvent *de);
void dropEvent(QDropEvent *de) override;
QList<boost::shared_ptr<const Mantid::API::MatrixWorkspace>>
getSelectedMatrixWorkspaces() const;
MantidSurfacePlotDialog::UserInputSurface
......@@ -187,8 +187,8 @@ public:
chooseContourPlotOptions(int nWorkspaces) const;
protected:
void dragMoveEvent(QDragMoveEvent *de);
void dragEnterEvent(QDragEnterEvent *de);
void dragMoveEvent(QDragMoveEvent *de) override;
void dragEnterEvent(QDragEnterEvent *de) override;
MantidSurfacePlotDialog::UserInputSurface
choosePlotOptions(const QString &type, int nWorkspaces) const;
......@@ -215,7 +215,7 @@ public:
private:
bool operator<(const QTreeWidgetItem &other) const;
bool operator<(const QTreeWidgetItem &other) const override;
MantidTreeWidget* m_parent;
static Mantid::Kernel::DateAndTime getLastModified(const QTreeWidgetItem*);
int m_sortPos;
......
......@@ -47,12 +47,12 @@ public:
/// Copy constructor
MantidMDCurve(const MantidMDCurve& c);
~MantidMDCurve();
~MantidMDCurve() override;
MantidMDCurve* clone(const Graph*)const;
MantidMDCurve *clone(const Graph *) const override;
/// Curve type. Used in the QtiPlot API.
int rtti() const{return Rtti_PlotUserItem;}
int rtti() const override { return Rtti_PlotUserItem; }
/// Used for waterfall plots: updates the data curves with an offset
//void loadData();
......@@ -61,21 +61,20 @@ public:
void setData(const QwtData &data);
/// Overrides qwt_plot_curve::boundingRect
QwtDoubleRect boundingRect() const;
QwtDoubleRect boundingRect() const override;
/// Return pointer to the data if it of the right type or 0 otherwise
MantidQwtIMDWorkspaceData* mantidData();
MantidQwtIMDWorkspaceData *mantidData() override;
/// Return pointer to the data if it of the right type or 0 otherwise, const version
virtual const MantidQwtIMDWorkspaceData* mantidData() const;
const MantidQwtIMDWorkspaceData *mantidData() const override;
/// Enables/disables drawing of error bars
void setErrorBars(bool yes=true,bool drawAll = false){m_drawErrorBars = yes;m_drawAllErrorBars = drawAll;}
virtual void draw(QPainter *p,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &) const;
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &) const override;
/// saves the MantidMatrixCurve details to project file.
QString saveToString();
......@@ -87,11 +86,10 @@ private:
using PlotCurve::draw; // Avoid Intel compiler warning
/// Init the curve
void init(Graph* g, bool distr, Graph::CurveType style);
void init(Graph *g, bool distr, Graph::CurveType style) override;
/// Handles delete notification
void postDeleteHandle(const std::string& wsName)
{
void postDeleteHandle(const std::string &wsName) override {
if (wsName == m_wsName.toStdString())
{
observePostDelete(false);
......@@ -99,13 +97,12 @@ private:
}
}
/// Handles afterReplace notification
void afterReplaceHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws);
void afterReplaceHandle(
const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
/// Handle an ADS clear notificiation
void clearADSHandle()
{
emit removeMe(this);
}
void clearADSHandle() override { emit removeMe(this); }
signals:
......
......@@ -145,8 +145,9 @@ public:
int precision();
// Loading and saving projects
void loadFromProject(const std::string& lines, ApplicationWindow* app, const int fileVersion);
std::string saveToProject(ApplicationWindow* app);
void loadFromProject(const std::string &lines, ApplicationWindow *app,
const int fileVersion) override;
std::string saveToProject(ApplicationWindow *app) override;
/// returns the workspace name
const std::string & getWorkspaceName();
......@@ -156,9 +157,13 @@ public:
/// A better solution is needed
void attachMultilayer(MultiLayer*);
void afterReplaceHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws);
void preDeleteHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws);
void clearADSHandle();
void afterReplaceHandle(
const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
void
preDeleteHandle(const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
void clearADSHandle() override;
signals:
void needWorkspaceChange(Mantid::API::MatrixWorkspace_sptr ws);
......@@ -229,7 +234,7 @@ signals:
void repaintAll();
void closeDependants();
// for context menu filtering
bool eventFilter(QObject *object, QEvent *e);
bool eventFilter(QObject *object, QEvent *e) override;
//to synchronize the views
void viewChanged(int);
......
......@@ -59,12 +59,12 @@ public:
/// Copy constructor
MantidMatrixCurve(const MantidMatrixCurve& c);
~MantidMatrixCurve();
~MantidMatrixCurve() override;
MantidMatrixCurve* clone(const Graph*)const;
MantidMatrixCurve *clone(const Graph *) const override;
/// Curve type. Used in the QtiPlot API.
int rtti() const{return Rtti_PlotUserItem;}
int rtti() const override { return Rtti_PlotUserItem; }
/// Used for waterfall plots: updates the data curves with an offset
void loadData();
......@@ -73,12 +73,12 @@ public:
void setData(const QwtData &data);
/// Overrides qwt_plot_curve::boundingRect
QwtDoubleRect boundingRect() const;
QwtDoubleRect boundingRect() const override;
/// Return pointer to the data if it of the right type or 0 otherwise
MantidQwtMatrixWorkspaceData *mantidData();
MantidQwtMatrixWorkspaceData *mantidData() override;
/// Return pointer to the data if it of the right type or 0 otherwise, const version
const MantidQwtMatrixWorkspaceData* mantidData() const;
const MantidQwtMatrixWorkspaceData *mantidData() const override;
/// Enables/disables drawing of error bars
void setErrorBars(bool yes=true,bool drawAll = false){m_drawErrorBars = yes;m_drawAllErrorBars = drawAll;}
......@@ -94,13 +94,12 @@ public:
/// Returns whether the can be normalized, i.e whether the workspace data is already divided by the width
bool isNormalizable() const;
virtual void draw(QPainter *p,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &) const;
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &) const override;
/// Overriden virtual method
void itemChanged();
void itemChanged() override;
/// saves the MantidMatrixCurve details to project file.
QString saveToString();
......@@ -119,11 +118,10 @@ private:
using PlotCurve::draw; // Avoid Intel compiler warning
/// Init the curve
void init(Graph* g, bool distr, Graph::CurveType style);
void init(Graph *g, bool distr, Graph::CurveType style) override;
/// Handles delete notification
void postDeleteHandle(const std::string& wsName)
{
void postDeleteHandle(const std::string &wsName) override {
if (wsName == m_wsName.toStdString())
{
observePostDelete(false);
......@@ -131,13 +129,12 @@ private:
}
}
/// Handles afterReplace notification
void afterReplaceHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws);
void afterReplaceHandle(
const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
/// Handle an ADS clear notificiation
void clearADSHandle()
{
emit removeMe(this);
}
void clearADSHandle() override { emit removeMe(this); }
signals:
......
......@@ -26,7 +26,7 @@ public:
private slots:
//! Accept changes and quit
void accept();
void accept() override;
//! Apply changes
void apply();
......
......@@ -8,16 +8,21 @@
class MantidMatrixDxExtensionHandler : public IMantidMatrixExtensionHandler {
public:
MantidMatrixDxExtensionHandler();
virtual ~MantidMatrixDxExtensionHandler();
virtual void setNumberFormat(MantidMatrixTabExtension& extension, const QChar& format,int precision);
virtual void recordFormat(MantidMatrixTabExtension& extension, const QChar &format, int precision);
virtual QChar getFormat(MantidMatrixTabExtension& extension);
virtual int getPrecision(MantidMatrixTabExtension& extension);
virtual void setColumnWidth(MantidMatrixTabExtension& extension, int width, int numberOfColumns);
virtual int getColumnWidth(MantidMatrixTabExtension& extension);
virtual QTableView* getTableView(MantidMatrixTabExtension& extension);
virtual void setColumnWidthPreference(MantidMatrixTabExtension& extension, int width);
virtual int getColumnWidthPreference(MantidMatrixTabExtension& extension);
~MantidMatrixDxExtensionHandler() override;
void setNumberFormat(MantidMatrixTabExtension &extension, const QChar &format,
int precision) override;
void recordFormat(MantidMatrixTabExtension &extension, const QChar &format,
int precision) override;
QChar getFormat(MantidMatrixTabExtension &extension) override;
int getPrecision(MantidMatrixTabExtension &extension) override;
void setColumnWidth(MantidMatrixTabExtension &extension, int width,
int numberOfColumns) override;
int getColumnWidth(MantidMatrixTabExtension &extension) override;
QTableView *getTableView(MantidMatrixTabExtension &extension) override;
void setColumnWidthPreference(MantidMatrixTabExtension &extension,
int width) override;
int getColumnWidthPreference(MantidMatrixTabExtension &extension) override;
private:
MantidMatrixModel::Type m_type;
};
......
......@@ -30,9 +30,13 @@ signals:
private:
/* Base class virtual methods */
void afterReplaceHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws);
void preDeleteHandle(const std::string& wsName, const boost::shared_ptr<Mantid::API::Workspace>);
void clearADSHandle();
void afterReplaceHandle(
const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
void
preDeleteHandle(const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace>) override;
void clearADSHandle() override;
MantidMatrixFunction *m_function;
};
......@@ -44,14 +48,14 @@ class MantidMatrixFunction: public Function2D
{
public:
explicit MantidMatrixFunction(MantidMatrix &matrix);
~MantidMatrixFunction();
~MantidMatrixFunction() override;
/* Base class virtual methods */
double operator()(double x, double y);
double getMinPositiveValue()const;
QString saveToString() const;
void connectToViewer(QObject *viewer);
double operator()(double x, double y) override;
double getMinPositiveValue() const override;
QString saveToString() const override;
void connectToViewer(QObject *viewer) override;
/* Public methods */
......
......@@ -32,8 +32,7 @@ public:
int start);
/// Implementation of QAbstractTableModel::rowCount() -- number of rows (spectra) that can be shown
int rowCount(const QModelIndex &parent = QModelIndex()) const
{
int rowCount(const QModelIndex &parent = QModelIndex()) const override {
(void)parent; //To avoid compiler warning
return m_rows;
}
......@@ -41,8 +40,7 @@ public:
/// Implementation of QAbstractTableModel::columnCount() -- number of columns. If type is X it is
/// the number of bin boundaries. If the type is DX it is the number of bin boundaries as well.
///If type is Y or E it is the number of data values.
int columnCount(const QModelIndex &parent = QModelIndex()) const
{
int columnCount(const QModelIndex &parent = QModelIndex()) const override {
(void)parent; //To avoid compiler warning
int columnCount = 0;
if (m_type == X || m_type == DX) {
......@@ -57,10 +55,11 @@ public:
/// Implementation of QAbstractTableModel::data(...). QTableView uses this function
/// to retrieve data for displaying.
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex & index ) const;
Qt::ItemFlags flags(const QModelIndex &index) const override;
// Set format and precision of displayed numbers.
void setFormat(const QChar& f,int prec);
......
......@@ -12,50 +12,50 @@ Mantid::Kernel::Logger g_log("MantidMatrixNullExtensionHandler");
class MantidMatrixNullExtensionHandler : public IMantidMatrixExtensionHandler {
public:
MantidMatrixNullExtensionHandler() {}
virtual ~MantidMatrixNullExtensionHandler() {}
~MantidMatrixNullExtensionHandler() override {}
virtual void setNumberFormat(MantidMatrixTabExtension& ,
const QChar &, int ) {
void setNumberFormat(MantidMatrixTabExtension &, const QChar &,
int) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
virtual void recordFormat(MantidMatrixTabExtension& , const QChar&, int) {
void recordFormat(MantidMatrixTabExtension &, const QChar &, int) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
virtual QChar getFormat(MantidMatrixTabExtension&) {
QChar getFormat(MantidMatrixTabExtension &) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
virtual int getPrecision(MantidMatrixTabExtension&) {
int getPrecision(MantidMatrixTabExtension &) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
virtual void setColumnWidth(MantidMatrixTabExtension&, int, int) {
void setColumnWidth(MantidMatrixTabExtension &, int, int) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
virtual int getColumnWidth(MantidMatrixTabExtension&) {
int getColumnWidth(MantidMatrixTabExtension &) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
virtual QTableView* getTableView(MantidMatrixTabExtension&) {
QTableView *getTableView(MantidMatrixTabExtension &) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
virtual void setColumnWidthPreference(MantidMatrixTabExtension&, int) {
void setColumnWidthPreference(MantidMatrixTabExtension &, int) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
virtual int getColumnWidthPreference(MantidMatrixTabExtension&) {
int getColumnWidthPreference(MantidMatrixTabExtension &) override {
throw std::runtime_error("You have seemed to attached an invalid extension to the "
"Mantid Matrix.");
}
......
......@@ -21,21 +21,21 @@ public:
const std::string & getWorkspaceName() {return m_wsName; }
//! is this table editable
virtual bool isEditable();
bool isEditable() override;
//! is this table sortable
virtual bool isSortable();
bool isSortable() override;
//! are the columns fixed - not editable by the GUI
virtual bool isFixedColumns() {return true;}
bool isFixedColumns() override { return true; }
virtual void sortTableDialog();
void sortTableDialog() override;
signals:
void needToClose();
void needToUpdate();
public slots:
void deleteRows(int startRow, int endRow);
void cellEdited(int,int col);
void deleteRows(int startRow, int endRow) override;
void cellEdited(int, int col) override;
protected slots:
void closeTable();
......@@ -45,12 +45,17 @@ protected slots:
void dealWithUnwantedResize();
protected:
void preDeleteHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws);
void afterReplaceHandle(const std::string& wsName,const boost::shared_ptr<Mantid::API::Workspace> ws);
void
preDeleteHandle(const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
void afterReplaceHandle(
const std::string &wsName,
const boost::shared_ptr<Mantid::API::Workspace> ws) override;
// Reimplemented methods for custom sorting of TableWorkspaces
virtual void sortColumn(int col, int order);
virtual void sortColumns(const QStringList& cols, int type = 0, int order = 0, const QString& leadCol = QString());
void sortColumn(int col, int order) override;
void sortColumns(const QStringList &cols, int type = 0, int order = 0,
const QString &leadCol = QString()) override;
private:
/// ITableWorkspace being displayed
......
......@@ -115,7 +115,7 @@ public:
explicit MantidUI(ApplicationWindow *aw);
// Destructor
~MantidUI();
~MantidUI() override;
//Clear the framework
void shutdown();
......
......@@ -180,7 +180,7 @@ public:
IntervalListValidator(QObject* parent, const IntervalList& intervals);
/// Overriden method to validate a given QString, at a particular position
virtual State validate(QString&, int&) const;
State validate(QString &, int &) const override;
private:
/// The IntervalList against which to validate.
......@@ -199,7 +199,7 @@ class MantidWSIndexWidget : public QWidget {
/// label.
explicit QLineEditWithErrorMark(QWidget *parent = 0);
/// virtual destructor to allow Qt to deallocate all objects
virtual ~QLineEditWithErrorMark(){};
~QLineEditWithErrorMark() override{};
/// provide acess to the QLineEdit
QLineEdit *lineEdit() { return _lineEdit; };
/// if Error is not empty, it will make the * label visible and set the
......
......@@ -79,11 +79,11 @@ public:
/// Constructor
PeakPickerTool(Graph *graph, MantidQt::MantidWidgets::FitPropertyBrowser *fitPropertyBrowser, MantidUI *mantidUI, bool showFitPropertyBrowser=true);
/// Destructor
~PeakPickerTool();
~PeakPickerTool() override;
/// Runtime type identifier
int rtti() const { return Rtti_SelectPeakTool;};
int rtti() const override { return Rtti_SelectPeakTool; };
/// Receives and processes mouse and keyboard events
bool eventFilter(QObject *obj, QEvent *event);
bool eventFilter(QObject *obj, QEvent *event) override;
/// Workspace name
const QString& workspaceName()const{return m_wsName;}
/// Spectrum index
......@@ -139,7 +139,8 @@ private:
void plotFitFunction(MantidQt::MantidWidgets::PropertyHandler* h);
void replot(MantidQt::MantidWidgets::PropertyHandler* h) const;
virtual void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &) const;
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &) const override;
// Add a new peak with centre c and height h.
void addPeak(double c,double h);
void addPeakAt(int x,int y);
......
......@@ -84,7 +84,7 @@ public:
*/
Matrix(ScriptingEnv *env, int r, int c, const QString& label, ApplicationWindow* parent, const QString& name = QString(), Qt::WFlags f=0);
Matrix(ScriptingEnv *env, const QImage& image, const QString& label, ApplicationWindow* parent, const QString& name = QString(), Qt::WFlags f=0);
~Matrix();
~Matrix() override;
enum Operation{Transpose, Invert, FlipHorizontally, FlipVertically, RotateClockwise,
RotateCounterClockwise, FFT, Clear, Calculate, MuParserCalculate, SetImage, ImportAscii};
......@@ -129,7 +129,7 @@ public:
/**
* Currently handles SCRIPTING_CHANGE_EVENT only.
*/
void customEvent(QEvent *e);
void customEvent(QEvent *e) override;
void resetView();
void moveCell(const QModelIndex& index);
......@@ -171,9 +171,9 @@ public:
QPixmap matrixIcon(){return m_matrix_icon;}
public slots:
void exportPDF(const QString& fileName);
void exportPDF(const QString &fileName) override;
//! Print the Matrix
void print();
void print() override;
//! Print the Matrix to fileName
void print(const QString& fileName);
......@@ -231,11 +231,12 @@ public slots:
void setFormula(const QString &s){formula_str = s;};