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