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

Find most cases of -Wsuggest-override in MantidPlot.

parent 08ea4369
......@@ -92,8 +92,8 @@ public:
void selectFilter(const QString & filter);
protected slots:
void closeEvent(QCloseEvent*);
//! Update which options are visible and enabled based on the output format.
void closeEvent(QCloseEvent *) override;
//! Update which options are visible and enabled based on the output format.
void updateAdvancedOptions (const QString &filter);
};
......
......@@ -72,8 +72,8 @@ public:
void setRect(int x, int y, int w, int h);
//! Return bounding rectangle in plot coordinates.
virtual QwtDoubleRect boundingRect() const;
//! Set position (xValue() and yValue()), right and bottom values giving everything in plot coordinates.
QwtDoubleRect boundingRect() const override;
//! Set position (xValue() and yValue()), right and bottom values giving everything in plot coordinates.
void setBoundingRect(double left, double top, double right, double bottom);
double right(){return d_x_right;};
......@@ -105,9 +105,10 @@ public:
private:
//! Does the actual drawing; see QwtPlotItem::draw.
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &r) const;
QPoint d_pos; //!< The position in paint coordinates.
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &r) const override;
QPoint d_pos; //!< The position in paint coordinates.
QPixmap d_pic; //!< The pixmap to be drawn.
QSize d_size; //!< The size (in paint coordinates) to which #d_pic will be scaled in draw().
QString d_file_name; //!< The file from which the image was loaded.
......
......@@ -163,8 +163,8 @@ private:
void previewTable();
void previewMatrix();
void closeEvent(QCloseEvent*);
//! Initialise #d_advanced_options and everything it contains.
void closeEvent(QCloseEvent *) override;
//! Initialise #d_advanced_options and everything it contains.
void initAdvancedOptions();
void setNewWindowsOnly(bool on);
void addColumnSeparators();
......
......@@ -48,7 +48,7 @@ public:
IntDialog(QWidget* parent = 0, Graph *g = 0, Qt::WFlags fl = 0 );
public slots:
void accept();
void accept() override;
private:
Graph *d_graph;
......
......@@ -52,11 +52,11 @@ public:
private:
void init();
QString logInfo();
QString logInfo() override;
void output();
void output() override;
double trapez();
double trapez();
double trapezf(int n);
//! Returns the number of iterations used to calculate the area if d_integrand = AnalyticalFunction.
int romberg();
......
......@@ -48,8 +48,9 @@ public:
private:
void init(int m);
void calculateOutputData(double *x, double *y);
int sortedCurveData(QwtPlotCurve *c, double start, double end, double **x, double **y);
void calculateOutputData(double *x, double *y) override;
int sortedCurveData(QwtPlotCurve *c, double start, double end, double **x,
double **y) override;
//! the interpolation method
int d_method;
......
......@@ -48,9 +48,9 @@ class LabelTool : public QObject, public QVector<QPoint>, public PlotToolInterfa
Q_OBJECT
public:
explicit LabelTool(Graph *graph);
virtual ~LabelTool();
virtual int rtti() const {return PlotToolInterface::Rtti_LabelTool;};
~LabelTool() override;
int rtti() const override { return PlotToolInterface::Rtti_LabelTool; };
void removeTextBox();
protected:
......
......@@ -47,8 +47,8 @@ public:
void setMultiLayer(MultiLayer *g);
protected slots:
void accept();
void update();
void accept() override;
void update();
void enableLayoutOptions(bool ok);
void swapLayers();
......
......@@ -42,9 +42,9 @@ class LegendWidget: public QWidget
public:
explicit LegendWidget(Plot *);
~LegendWidget();
~LegendWidget() override;
void clone(LegendWidget* t);
void clone(LegendWidget* t);
QwtPlot *plot(){return d_plot;};
//! The kinds of frame a LegendWidget can draw around the Text.
......@@ -96,11 +96,13 @@ private:
int symbolsMaxWidth();
QString parse(const QString& str);
virtual void paintEvent(QPaintEvent *e);
void mousePressEvent(QMouseEvent *e);
void contextMenuEvent(QContextMenuEvent * ){emit showMenu();};
void paintEvent(QPaintEvent *e) override;
void mousePressEvent(QMouseEvent *e) override;
void contextMenuEvent(QContextMenuEvent *) override {
emit showMenu();
};
//! Parent plot
//! Parent plot
Plot *d_plot;
//! Frame type
......
......@@ -61,8 +61,8 @@ public slots:
void setDefaultValues();
void displayCoordinates(int unit);
void setLineStyle(Qt::PenStyle style);
void accept();
void apply();
void accept() override;
void apply();
private:
ArrowMarker *lm;
......
......@@ -67,9 +67,11 @@ class LineProfileTool : public QWidget, public PlotToolInterface
LineProfileTool(Graph *graph, ApplicationWindow *app, int average_pixels);
void calculateLineProfile(const QPoint &start, const QPoint &end);
virtual int rtti() const {return PlotToolInterface::Rtti_LineProfileTool;};
int rtti() const override {
return PlotToolInterface::Rtti_LineProfileTool;
};
signals:
signals:
/** Emitted whenever a new message should be presented to the user.
*
* You don't have to connect to this signal if you alreay specified a reciever during initialization.
......@@ -81,20 +83,20 @@ class LineProfileTool : public QWidget, public PlotToolInterface
void addLineMarker(const QPoint &start, const QPoint &end);
/**\brief Draw line during operation (replaced by a LineMarker at the end).
*/
virtual void paintEvent(QPaintEvent *e);
/**\brief Pressing the left mouse button starts line selection.
void paintEvent(QPaintEvent *e) override;
/**\brief Pressing the left mouse button starts line selection.
*
* Clicks with anything else than the left button are propagated to the parent as usual.
*/
virtual void mousePressEvent(QMouseEvent *e);
/**\brief Mouse movements need to be monitored for updating the line during operation.
void mousePressEvent(QMouseEvent *e) override;
/**\brief Mouse movements need to be monitored for updating the line during operation.
*/
virtual void mouseMoveEvent(QMouseEvent *e);
/**\brief Mouse releases end line selection and cause the profile to be displayed.
void mouseMoveEvent(QMouseEvent *e) override;
/**\brief Mouse releases end line selection and cause the profile to be displayed.
*/
virtual void mouseReleaseEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e) override;
private:
private:
ApplicationWindow *d_app;
//! Number of image pixels over which to average.
int d_average_pixels;
......
......@@ -41,12 +41,15 @@ class LogisticFit : public Fit
LogisticFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
LogisticFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1);
void guessInitialValues();
double eval(double *par, double x){return (par[0]-par[1])/(1+pow(x/par[2], par[3]))+par[1];};
void guessInitialValues() override;
double eval(double *par, double x) override {
return (par[0] - par[1]) / (1 + pow(x / par[2], par[3])) +
par[1];
};
private:
private:
void init();
void calculateFitCurveData(double *X, double *Y);
void calculateFitCurveData(double *X, double *Y) override;
};
#endif
......@@ -64,7 +64,8 @@ public:
void populateAlgHistoryTreeWidget(const Mantid::API::WorkspaceHistory& wsHist);
protected:
void selectionChanged ( const QItemSelection & selected, const QItemSelection & deselected );
void selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected) override;
private slots:
void onItemChanged(QTreeWidgetItem* item, int index);
......@@ -90,7 +91,7 @@ class AlgExecSummaryGrpBox: public QGroupBox
public:
explicit AlgExecSummaryGrpBox(QWidget *w);
AlgExecSummaryGrpBox(QString,QWidget*w);
~AlgExecSummaryGrpBox();
~AlgExecSummaryGrpBox() override;
void setData(const double execDuration,const Mantid::Kernel::DateAndTime execDate);
private:
QLineEdit* getAlgExecDurationCtrl()const {return m_execDurationEdit;}
......@@ -111,7 +112,7 @@ class AlgEnvHistoryGrpBox: public QGroupBox
public:
explicit AlgEnvHistoryGrpBox(QWidget *w);
AlgEnvHistoryGrpBox(QString,QWidget*w);
~AlgEnvHistoryGrpBox();
~AlgEnvHistoryGrpBox() override;
QLineEdit* getosNameEdit()const {return m_osNameEdit;}
QLineEdit* getosVersionEdit()const {return m_osVersionEdit;}
......@@ -137,7 +138,7 @@ class AlgorithmHistoryWindow: public MantidQt::API::MantidDialog
public:
AlgorithmHistoryWindow(QWidget *parent,const boost::shared_ptr<const Mantid::API::Workspace>);
~AlgorithmHistoryWindow();
~AlgorithmHistoryWindow() override;
public slots:
void updateAll(Mantid::API::AlgorithmHistory_const_sptr algHistmakeory);
void doUnroll(const std::vector<int>& unrollIndicies );
......
......@@ -29,7 +29,7 @@ public:
/// Constructor
explicit AlgorithmMonitor(MantidUI *m);
/// Destructor
~AlgorithmMonitor();
~AlgorithmMonitor() override;
/// Add algorithm to monitor
void add(Mantid::API::IAlgorithm_sptr alg);
/// Removes stopped algorithm
......@@ -88,7 +88,7 @@ class MonitorDlg: public QDialog
Q_OBJECT
public:
MonitorDlg(QWidget *parent,AlgorithmMonitor *algMonitor);
~MonitorDlg();
~MonitorDlg() override;
public slots:
void update();
// The void* corresponds to Mantid::API::AlgorithmID, but Qt wasn't coping with the typedef
......
......@@ -49,20 +49,20 @@ class FlowLayout : public QLayout
public:
FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
~FlowLayout();
~FlowLayout() override;
void addItem(QLayoutItem *item);
void addItem(QLayoutItem *item) override;
int horizontalSpacing() const;
int verticalSpacing() const;
Qt::Orientations expandingDirections() const;
bool hasHeightForWidth() const;
int heightForWidth(int) const;
int count() const;
QLayoutItem *itemAt(int index) const;
QSize minimumSize() const;
void setGeometry(const QRect &rect);
QSize sizeHint() const;
QLayoutItem *takeAt(int index);
Qt::Orientations expandingDirections() const override;
bool hasHeightForWidth() const override;
int heightForWidth(int) const override;
int count() const override;
QLayoutItem *itemAt(int index) const override;
QSize minimumSize() const override;
void setGeometry(const QRect &rect) override;
QSize sizeHint() const override;
QLayoutItem *takeAt(int index) override;
private:
int doLayout(const QRect &rect, bool testOnly) const;
......
......@@ -7,7 +7,7 @@
class IMantidMatrixExtensionHandler : public Mantid::Kernel::Chainable<IMantidMatrixExtensionHandler> {
public:
virtual ~IMantidMatrixExtensionHandler() {}
~IMantidMatrixExtensionHandler() override {}
virtual void setNumberFormat(MantidMatrixTabExtension& extension,
const QChar &format, int precision) = 0;
virtual void recordFormat(MantidMatrixTabExtension& extension, const QChar &format, int precision) = 0;
......
......@@ -16,7 +16,7 @@ class ImportWorkspaceDlg : public QDialog
public:
ImportWorkspaceDlg(QWidget *parent = 0, size_t num = 0);
~ImportWorkspaceDlg();
~ImportWorkspaceDlg() override;
int getLowerLimit() { return lowerLimit; }
int getUpperLimit() { return upperLimit; }
......
......@@ -28,11 +28,11 @@ public:
const QString &label = QString(),
ApplicationWindow *parent = nullptr,
const QString &name = QString());
~InstrumentWindow();
~InstrumentWindow() override;
void loadFromProject(const std::string &lines, ApplicationWindow *app,
const int fileVersion);
std::string saveToProject(ApplicationWindow *app);
const int fileVersion) override;
std::string saveToProject(ApplicationWindow *app) override;
void selectTab(int tab);
MantidQt::MantidWidgets::InstrumentWidgetTab *getTab(const QString & title) const;
MantidQt::MantidWidgets::InstrumentWidgetTab *getTab(int tab) const;
......
......@@ -17,9 +17,9 @@ class loadDAEDlg : public QDialog
public:
explicit loadDAEDlg(QWidget *parent = 0);
~loadDAEDlg();
~loadDAEDlg() override;
const QString& getHostName() { return m_hostName; }
const QString& getHostName() { return m_hostName; }
const QString& getWorkspaceName() { return m_workspaceName; }
const QString& getSpectrumMin() { return m_spectrum_min; }
const QString& getSpectrumMax() { return m_spectrum_max; }
......
......@@ -12,7 +12,7 @@ class MantidApplication:public QApplication
public:
MantidApplication(int & argc, char ** argv );
/// Reimplement notify to catch exceptions from event handlers
virtual bool notify(QObject * receiver, QEvent * event );
bool notify(QObject *receiver, QEvent *event) override;
};
#endif // MANTIDAPPLICATION_H_
......
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