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

Find most cases of -Wsuggest-override in MantidPlot.

parent 08ea4369
...@@ -130,7 +130,7 @@ class ApplicationWindow: public QMainWindow, public Scripted ...@@ -130,7 +130,7 @@ class ApplicationWindow: public QMainWindow, public Scripted
public: public:
ApplicationWindow(bool factorySettings, const QStringList& args); ApplicationWindow(bool factorySettings, const QStringList& args);
explicit ApplicationWindow(bool factorySettings = false); explicit ApplicationWindow(bool factorySettings = false);
~ApplicationWindow(); ~ApplicationWindow() override;
enum ShowWindowsPolicy{HideAll, ActiveFolder, SubFolders}; enum ShowWindowsPolicy{HideAll, ActiveFolder, SubFolders};
enum WindowType{NoWindow, TableWindow, MatrixWindow, MultiLayerWindow, NoteWindow, Plot3DWindow}; enum WindowType{NoWindow, TableWindow, MatrixWindow, MultiLayerWindow, NoteWindow, Plot3DWindow};
...@@ -673,12 +673,12 @@ public slots: ...@@ -673,12 +673,12 @@ public slots:
//! \name Event Handlers //! \name Event Handlers
//@{ //@{
void closeEvent( QCloseEvent*); void closeEvent(QCloseEvent *) override;
void timerEvent ( QTimerEvent *e); void timerEvent(QTimerEvent *e) override;
void dragEnterEvent( QDragEnterEvent* e ); void dragEnterEvent(QDragEnterEvent *e) override;
void dragMoveEvent( QDragMoveEvent* e );//Mantid void dragMoveEvent(QDragMoveEvent *e) override; // Mantid
void dropEvent( QDropEvent* e ); void dropEvent(QDropEvent *e) override;
void customEvent( QEvent* e); void customEvent(QEvent *e) override;
//@} //@}
//! \name Dialogs //! \name Dialogs
...@@ -1065,10 +1065,10 @@ signals: ...@@ -1065,10 +1065,10 @@ signals:
//void changeToMDI(MdiSubWindow*); //void changeToMDI(MdiSubWindow*);
protected: protected:
virtual bool event(QEvent * e); bool event(QEvent *e) override;
private: private:
virtual QMenu * createPopupMenu(){return NULL;} QMenu *createPopupMenu() override { return NULL; }
void populateMantidTreeWidget(const QString &s); void populateMantidTreeWidget(const QString &s);
void loadWsToMantidTree(const std::string& wsName); void loadWsToMantidTree(const std::string& wsName);
......
...@@ -111,8 +111,8 @@ public: ...@@ -111,8 +111,8 @@ public:
QRect rect() const {return QRect(startPoint(), endPoint()).normalize();}; QRect rect() const {return QRect(startPoint(), endPoint()).normalize();};
//! Returns the bounding rectangle in plot coordinates. //! Returns the bounding rectangle in plot coordinates.
QwtDoubleRect boundingRect() const; QwtDoubleRect boundingRect() const override;
void setBoundingRect(double xs, double ys, double xe, double ye); void setBoundingRect(double xs, double ys, double xe, double ye);
//! Recalculates the bounding rectangle in values coordinates using the pixel coordinats when the scales change //! Recalculates the bounding rectangle in values coordinates using the pixel coordinats when the scales change
void updateBoundingRect(); void updateBoundingRect();
...@@ -123,11 +123,12 @@ public: ...@@ -123,11 +123,12 @@ public:
void setEditable(bool yes); void setEditable(bool yes);
//! Filters events for the canvas while #d_editable is true. //! Filters events for the canvas while #d_editable is true.
bool eventFilter(QObject *o, QEvent *e); bool eventFilter(QObject *o, QEvent *e) override;
private: private:
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &r) const; void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
double theta(int xs, int ys, int xe, int ye) const; const QRect &r) const override;
double theta(int xs, int ys, int xe, int ye) const;
//! Flag specifying if the start arrow is visible //! Flag specifying if the start arrow is visible
bool d_start_arrow; bool d_start_arrow;
......
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
private slots: private slots:
void updateTable(int index); void updateTable(int index);
void updateCurves(); void updateCurves();
void accept(); void accept() override;
void processStateChange(QTableWidgetItem* item); void processStateChange(QTableWidgetItem* item);
private: private:
......
...@@ -74,7 +74,7 @@ class AxesDialog: public QDialog ...@@ -74,7 +74,7 @@ class AxesDialog: public QDialog
public: public:
AxesDialog(ApplicationWindow* app, Graph* g, Qt::WFlags fl = 0); AxesDialog(ApplicationWindow* app, Graph* g, Qt::WFlags fl = 0);
virtual ~AxesDialog(); ~AxesDialog() override;
public slots: public slots:
void setCurrentScale(int axisPos); void setCurrentScale(int axisPos);
...@@ -86,7 +86,7 @@ class AxesDialog: public QDialog ...@@ -86,7 +86,7 @@ class AxesDialog: public QDialog
private slots: private slots:
bool pressToGraph(); bool pressToGraph();
void apply(); void apply();
void accept(); void accept() override;
void updateGrid(); void updateGrid();
void changeMinorTicksLength(int minLength); void changeMinorTicksLength(int minLength);
void changeMajorTicksLength(int majLength); void changeMajorTicksLength(int majLength);
......
...@@ -54,7 +54,7 @@ class AxisDetails: public QWidget ...@@ -54,7 +54,7 @@ class AxisDetails: public QWidget
//details for each axis in the Axis tab //details for each axis in the Axis tab
public: public:
AxisDetails(ApplicationWindow* app, Graph* graph, int mappedaxis, QWidget *parent = 0); // populate and fill in with existing data AxisDetails(ApplicationWindow* app, Graph* graph, int mappedaxis, QWidget *parent = 0); // populate and fill in with existing data
virtual ~AxisDetails(); ~AxisDetails() override;
void initWidgets(); void initWidgets();
bool modified(){return m_modified;} bool modified(){return m_modified;}
void apply(); void apply();
......
...@@ -38,12 +38,12 @@ public: ...@@ -38,12 +38,12 @@ public:
Bar(); Bar();
explicit Bar(double rad); explicit Bar(double rad);
Qwt3D::Enrichment* clone() const {return new Bar(*this);} Qwt3D::Enrichment *clone() const override { return new Bar(*this); }
void configure(double rad); void configure(double rad);
void drawBegin(); void drawBegin() override;
void drawEnd(); void drawEnd() override;
void draw(Qwt3D::Triple const&); void draw(Qwt3D::Triple const &) override;
private: private:
double radius_; double radius_;
......
...@@ -44,9 +44,9 @@ public: ...@@ -44,9 +44,9 @@ public:
void copy(const BoxCurve *b); void copy(const BoxCurve *b);
virtual QwtDoubleRect boundingRect() const; QwtDoubleRect boundingRect() const override;
QwtSymbol::Style minStyle(){return min_style;}; QwtSymbol::Style minStyle(){return min_style;};
void setMinStyle(QwtSymbol::Style s){min_style = s;}; void setMinStyle(QwtSymbol::Style s){min_style = s;};
QwtSymbol::Style maxStyle(){return max_style;}; QwtSymbol::Style maxStyle(){return max_style;};
...@@ -75,13 +75,13 @@ public: ...@@ -75,13 +75,13 @@ public:
int whiskersRangeType(){return w_range;}; int whiskersRangeType(){return w_range;};
void setWhiskersRange(int type, double coeff); void setWhiskersRange(int type, double coeff);
void loadData(); void loadData() override;
private: private:
using DataCurve::draw; // Unhide base class method (avoids Intel compiler warning) using DataCurve::draw; // Unhide base class method (avoids Intel compiler warning)
void draw(QPainter *painter,const QwtScaleMap &xMap, void draw(QPainter *painter, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, int from, int to) const; const QwtScaleMap &yMap, int from, int to) const override;
void drawBox(QPainter *painter, const QwtScaleMap &xMap, void drawBox(QPainter *painter, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, double *dat, int size) const; const QwtScaleMap &yMap, double *dat, int size) const;
using DataCurve::drawSymbols; // Unhide base class method (avoids Intel compiler warning) using DataCurve::drawSymbols; // Unhide base class method (avoids Intel compiler warning)
void drawSymbols(QPainter *painter, const QwtScaleMap &xMap, void drawSymbols(QPainter *painter, const QwtScaleMap &xMap,
...@@ -103,11 +103,13 @@ public: ...@@ -103,11 +103,13 @@ public:
d_x = x; d_x = x;
}; };
virtual QwtData *copy() const{return new QwtSingleArrayData(d_x, d_y, size());}; QwtData *copy() const override {
return new QwtSingleArrayData(d_x, d_y, size());
};
virtual size_t size() const{return d_y.size();}; size_t size() const override { return d_y.size(); };
virtual double x(size_t) const{return d_x;}; double x(size_t) const override { return d_x; };
virtual double y(size_t i) const{return d_y[static_cast<int>(i)];}; double y(size_t i) const override { return d_y[static_cast<int>(i)]; };
private: private:
QwtArray<double> d_y; QwtArray<double> d_y;
......
...@@ -43,8 +43,8 @@ class CanvasPicker: public QObject ...@@ -43,8 +43,8 @@ class CanvasPicker: public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit CanvasPicker(Graph *plot); explicit CanvasPicker(Graph *plot);
virtual bool eventFilter(QObject *, QEvent *); bool eventFilter(QObject *, QEvent *) override;
void selectPoints(int n); void selectPoints(int n);
void selectPeak(const QPoint& p); void selectPeak(const QPoint& p);
//! Disable editing of #d_editing_marker on a TAB-key event. //! Disable editing of #d_editing_marker on a TAB-key event.
......
...@@ -37,12 +37,12 @@ class Cone3D : public Qwt3D::VertexEnrichment ...@@ -37,12 +37,12 @@ class Cone3D : public Qwt3D::VertexEnrichment
public: public:
Cone3D(); Cone3D();
Cone3D(double rad, unsigned quality); Cone3D(double rad, unsigned quality);
~Cone3D(); ~Cone3D() override;
Qwt3D::Enrichment *clone() const override { return new Cone3D(*this); }
Qwt3D::Enrichment* clone() const {return new Cone3D(*this);}
void configure(double rad, unsigned quality); void configure(double rad, unsigned quality);
void draw(Qwt3D::Triple const&); void draw(Qwt3D::Triple const &) override;
private: private:
GLUquadricObj *hat; GLUquadricObj *hat;
......
...@@ -56,8 +56,8 @@ public: ...@@ -56,8 +56,8 @@ public:
* @param parent :: parent widget (only affects placement of the widget) * @param parent :: parent widget (only affects placement of the widget)
*/ */
ContourLinesEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0); ContourLinesEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0);
~ContourLinesEditor(); ~ContourLinesEditor() override;
//! Use this function to initialize the values. //! Use this function to initialize the values.
void setSpectrogram(Spectrogram *sp); void setSpectrogram(Spectrogram *sp);
//! Updates levels in the target spectrogram and replots it. //! Updates levels in the target spectrogram and replots it.
void updateContourLevels(); void updateContourLevels();
...@@ -74,7 +74,7 @@ protected slots: ...@@ -74,7 +74,7 @@ protected slots:
void spinBoxActivated(DoubleSpinBox *); void spinBoxActivated(DoubleSpinBox *);
void updatePen(); void updatePen();
bool eventFilter(QObject *object, QEvent *e); bool eventFilter(QObject *object, QEvent *e) override;
private: private:
void updatePenColumn(); void updatePenColumn();
......
...@@ -38,8 +38,10 @@ Q_OBJECT ...@@ -38,8 +38,10 @@ Q_OBJECT
public: public:
Convolution(ApplicationWindow *parent, Table *t, const QString& signalColName, const QString& responseColName); Convolution(ApplicationWindow *parent, Table *t, const QString& signalColName, const QString& responseColName);
bool setDataFromTable(Table *t, const QString& signalColName, const QString& responseColName, int = 1, int = -1); bool setDataFromTable(Table *t, const QString &signalColName,
//! Returns the size of the signal data set const QString &responseColName, int = 1,
int = -1) override;
//! Returns the size of the signal data set
int signalDataSize(){return d_n_signal;}; int signalDataSize(){return d_n_signal;};
//! Returns the size of the response data set //! Returns the size of the response data set
int responseDataSize(){return d_n_response;}; int responseDataSize(){return d_n_response;};
...@@ -51,8 +53,8 @@ protected: ...@@ -51,8 +53,8 @@ protected:
void convlv(double *sig, int n, double *dres, int m, int sign); void convlv(double *sig, int n, double *dres, int m, int sign);
private: private:
virtual void output(); void output() override;
//! Size of the signal data set //! Size of the signal data set
int d_n_signal; int d_n_signal;
//! Size of the response data set //! Size of the response data set
int d_n_response; int d_n_response;
...@@ -66,7 +68,7 @@ public: ...@@ -66,7 +68,7 @@ public:
Deconvolution(ApplicationWindow *parent, Table *t, const QString& realColName, const QString& imagColName = QString()); Deconvolution(ApplicationWindow *parent, Table *t, const QString& realColName, const QString& imagColName = QString());
private: private:
void output(); void output() override;
}; };
#endif #endif
...@@ -38,14 +38,16 @@ Q_OBJECT ...@@ -38,14 +38,16 @@ Q_OBJECT
public: public:
Correlation(ApplicationWindow *parent, Table *t, const QString& colName1, const QString& colName2, int startRow = 1, int endRow = -1); Correlation(ApplicationWindow *parent, Table *t, const QString& colName1, const QString& colName2, int startRow = 1, int endRow = -1);
bool setDataFromTable(Table *t, const QString& colName1, const QString& colName2, int startRow = 1, int endRow = -1); bool setDataFromTable(Table *t, const QString &colName1,
const QString &colName2, int startRow = 1,
int endRow = -1) override;
protected: protected:
//! Handles the graphical output //! Handles the graphical output
void addResultCurve(); void addResultCurve();
private: private:
virtual void output(); void output() override;
}; };
#endif #endif
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
public slots: public slots:
void setCurveToModify(Graph *g, int curve); void setCurveToModify(Graph *g, int curve);
void accept(); void accept() override;
private: private:
DataCurve *d_curve; DataCurve *d_curve;
......
...@@ -47,7 +47,7 @@ class CurvesDialog : public QDialog ...@@ -47,7 +47,7 @@ class CurvesDialog : public QDialog
public: public:
CurvesDialog( ApplicationWindow* app, Graph* g, Qt::WFlags fl = 0 ); CurvesDialog( ApplicationWindow* app, Graph* g, Qt::WFlags fl = 0 );
~CurvesDialog(); ~CurvesDialog() override;
private slots: private slots:
void addCurves(); void addCurves();
...@@ -67,12 +67,12 @@ private slots: ...@@ -67,12 +67,12 @@ private slots:
private: private:
void setGraph(Graph *graph); void setGraph(Graph *graph);
void closeEvent(QCloseEvent*); void closeEvent(QCloseEvent *) override;
void init(); void init();
bool addCurve(const QString& name); bool addCurve(const QString& name);
QSize sizeHint() const; QSize sizeHint() const override;
void contextMenuEvent(QContextMenuEvent *); void contextMenuEvent(QContextMenuEvent *) override;
ApplicationWindow* d_app; ApplicationWindow* d_app;
Graph *d_graph; Graph *d_graph;
......
...@@ -87,14 +87,18 @@ class CustomActionHandler : public QXmlDefaultHandler ...@@ -87,14 +87,18 @@ class CustomActionHandler : public QXmlDefaultHandler
public: public:
explicit CustomActionHandler(QAction *action); explicit CustomActionHandler(QAction *action);
bool startElement(const QString &namespaceURI, const QString &localName, bool startElement(const QString &namespaceURI, const QString &localName,
const QString &qName, const QXmlAttributes &attributes); const QString &qName,
bool endElement(const QString &namespaceURI, const QString &localName, const QXmlAttributes &attributes) override;
const QString &qName); bool endElement(const QString &namespaceURI, const QString &localName,
bool characters(const QString &str){currentText += str; return true;}; const QString &qName) override;
bool fatalError(const QXmlParseException &){return false;}; bool characters(const QString &str) override {
QString errorString() const {return errorStr;}; currentText += str;
QString parentName(){return d_widget_name;}; return true;
};
bool fatalError(const QXmlParseException &) override { return false; };
QString errorString() const override { return errorStr; };
QString parentName(){return d_widget_name;};
private: private:
bool metFitTag; bool metFitTag;
......
...@@ -47,15 +47,17 @@ class DataPickerTool : public QwtPlotPicker, public PlotToolInterface ...@@ -47,15 +47,17 @@ class DataPickerTool : public QwtPlotPicker, public PlotToolInterface
enum Mode { Display, Move, Remove }; enum Mode { Display, Move, Remove };
enum MoveMode {Free, Vertical, Horizontal}; enum MoveMode {Free, Vertical, Horizontal};
DataPickerTool(Graph *graph, ApplicationWindow *app, Mode mode, const QObject *status_target=NULL, const char *status_slot=""); DataPickerTool(Graph *graph, ApplicationWindow *app, Mode mode, const QObject *status_target=NULL, const char *status_slot="");
virtual ~DataPickerTool(); ~DataPickerTool() override;
Mode getMode()const{return d_mode;} Mode getMode()const{return d_mode;}
virtual bool eventFilter(QObject *obj, QEvent *event); bool eventFilter(QObject *obj, QEvent *event) override;
bool keyEventFilter(QKeyEvent *ke); bool keyEventFilter(QKeyEvent *ke);
QwtPlotCurve *selectedCurve() const { return d_selected_curve; } QwtPlotCurve *selectedCurve() const { return d_selected_curve; }
virtual int rtti() const {return PlotToolInterface::Rtti_DataPicker;}; int rtti() const override {
return PlotToolInterface::Rtti_DataPicker;
};
signals: signals:
/** Emitted whenever a new message should be presented to the user. /** 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. * You don't have to connect to this signal if you alreay specified a reciever during initialization.
...@@ -64,8 +66,8 @@ class DataPickerTool : public QwtPlotPicker, public PlotToolInterface ...@@ -64,8 +66,8 @@ class DataPickerTool : public QwtPlotPicker, public PlotToolInterface
//! Emitted whenever a new data point has been selected. //! Emitted whenever a new data point has been selected.
void selected(QwtPlotCurve*, int); void selected(QwtPlotCurve*, int);
protected: protected:
virtual void append(const QPoint &point); void append(const QPoint &point) override;
void setSelection(QwtPlotCurve *curve, int point_index); void setSelection(QwtPlotCurve *curve, int point_index);
private: private:
ApplicationWindow *d_app; ApplicationWindow *d_app;
QwtPlotMarker d_selection_marker; QwtPlotMarker d_selection_marker;
......
...@@ -48,8 +48,8 @@ public: ...@@ -48,8 +48,8 @@ public:
DataSetDialog( const QString& text, ApplicationWindow* app, Graph* g = NULL, Qt::WFlags fl = 0 ); DataSetDialog( const QString& text, ApplicationWindow* app, Graph* g = NULL, Qt::WFlags fl = 0 );
public slots: public slots:
void accept(); void accept() override;
void setCurveNames(const QStringList& names); void setCurveNames(const QStringList& names);
void setOperationType(ApplicationWindow::Analysis operation){d_operation = operation;} void setOperationType(ApplicationWindow::Analysis operation){d_operation = operation;}
void setCurentDataSet(const QString& s); void setCurentDataSet(const QString& s);
......
...@@ -43,6 +43,6 @@ public: ...@@ -43,6 +43,6 @@ public:
private: private:
void init(); void init();
void output(); void output() override;
}; };
#endif #endif
...@@ -25,9 +25,8 @@ public slots: ...@@ -25,9 +25,8 @@ public slots:
void dragMouseMove(QPoint); void dragMouseMove(QPoint);
protected: protected:
bool event(QEvent *ev) override;
bool event(QEvent *ev); void moveEvent(QMoveEvent *ev) override;
void moveEvent(QMoveEvent *ev);
private: private:
......
...@@ -75,7 +75,7 @@ private: ...@@ -75,7 +75,7 @@ private:
protected slots: protected slots:
//! Set all string in the current language //! Set all string in the current language
virtual void languageChange(); void languageChange() override;
public slots: public slots:
//! Add a plot definition //! Add a plot definition
......
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