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

Find most cases of -Wsuggest-override in MantidPlot.

parent 08ea4369
......@@ -61,7 +61,7 @@ signals:
void options3(const QString&,double,double,double,double,double,int);
private:
void closeEvent (QCloseEvent *);
void closeEvent(QCloseEvent *) override;
Fit *fitter;
Graph *graph;
......
......@@ -42,14 +42,16 @@ class ExponentialFit : public Fit
double start, double end, bool expGrowth = false);
ExponentialFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1, bool expGrowth = false);
double eval(double *par, double x){return par[0]*exp(-par[1]*x) + par[2];};
double eval(double *par, double x) override {
return par[0] * exp(-par[1] * x) + par[2];
};
private:
private:
void init();
void customizeFitResults();
void calculateFitCurveData(double *X, double *Y);
void customizeFitResults() override;
void calculateFitCurveData(double *X, double *Y) override;
bool is_exp_growth;
bool is_exp_growth;
};
class TwoExpFit : public Fit
......@@ -62,12 +64,15 @@ class TwoExpFit : public Fit
TwoExpFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
TwoExpFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1);
double eval(double *par, double x){return par[0]*exp(-par[1]*x)+par[2]*exp(-par[3]*x)+par[4];};
double eval(double *par, double x) override {
return par[0] * exp(-par[1] * x) + par[2] * exp(-par[3] * x) +
par[4];
};
private:
private:
void init();
void customizeFitResults();
void calculateFitCurveData(double *X, double *Y);
void customizeFitResults() override;
void calculateFitCurveData(double *X, double *Y) override;
};
class ThreeExpFit : public Fit
......@@ -80,11 +85,14 @@ class ThreeExpFit : public Fit
ThreeExpFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
ThreeExpFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1);
double eval(double *par, double x){return par[0]*exp(-x*par[1])+par[2]*exp(-x*par[3])+par[4]*exp(-x*par[5])+par[6];};
double eval(double *par, double x) override {
return par[0] * exp(-x * par[1]) + par[2] * exp(-x * par[3]) +
par[4] * exp(-x * par[5]) + par[6];
};
private:
private:
void init();
void customizeFitResults();
void calculateFitCurveData(double *X, double *Y);
void customizeFitResults() override;
void calculateFitCurveData(double *X, double *Y) override;
};
#endif
......@@ -50,7 +50,7 @@ public:
ExportDialog(const QString& tableName, QWidget* parent = 0, Qt::WFlags fl = 0 );
private:
void closeEvent(QCloseEvent*);
void closeEvent(QCloseEvent *) override;
QPushButton* buttonOk;
QPushButton* buttonCancel;
......@@ -80,8 +80,8 @@ private slots:
protected slots:
//! Accept changes
void accept();
//! Display help
void accept() override;
//! Display help
void help();
};
......
......@@ -47,13 +47,15 @@ public:
private:
void init();
void output();
void output() override;
void output(const QString &text);
QString fftCurve();
QString fftTable();
bool setDataFromTable(Table *t, const QString& realColName, const QString& imagColName = QString(), int from = 0, int to = -1);
bool setDataFromTable(Table *t, const QString &realColName,
const QString &imagColName = QString(), int from = 0,
int to = -1) override;
double d_sampling;
//! Flag telling if an inverse FFT must be performed.
......
......@@ -55,7 +55,7 @@ public slots:
void setTable(Table *t);
void setMatrix(Matrix *m);
void activateCurve(const QString& curveName);
void accept();
void accept() override;
private:
void fftMatrix();
......
......@@ -55,7 +55,7 @@ public:
private:
void init(int m);
void calculateOutputData(double *x, double *y);
void calculateOutputData(double *x, double *y) override;
//! The filter type.
FilterType d_filter_type;
......
......@@ -45,9 +45,9 @@ class Filter : public QObject
public:
Filter(ApplicationWindow *parent, Table *t = 0, const QString& name = QString());
Filter(ApplicationWindow *parent, Graph *g = 0, const QString& name = QString());
~Filter();
~Filter() override;
//! Actually does the job. Should be reimplemented in derived classes.
//! Actually does the job. Should be reimplemented in derived classes.
virtual bool run();
virtual void setDataCurve(int curve, double start, double end);
......
......@@ -44,7 +44,7 @@ class FindDialog : public QDialog
public:
FindDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
~FindDialog();
~FindDialog() override;
private:
QPushButton* buttonFind;
......@@ -69,7 +69,7 @@ public slots:
protected slots:
void accept();
void accept() override;
};
#endif // exportDialog_H
......@@ -58,19 +58,24 @@ class Fit : public Filter
Fit(ApplicationWindow *parent, Graph *g = 0, const QString& name = QString());
Fit(ApplicationWindow *parent, Table *t, const QString& name = QString());
~Fit();
~Fit() override;
//! Actually does the fit. Should be reimplemented in derived classes.
//! Actually does the fit. Should be reimplemented in derived classes.
virtual void fit();
virtual bool run(){fit(); return true;};
bool run() override {
fit();
return true;
};
//! Sets the data set to be used for weighting
//! Sets the data set to be used for weighting
bool setWeightingData(WeightingMethod w, const QString& colName = QString::null);
void setDataCurve(int curve, double start, double end);
bool setDataFromTable(Table *t, const QString& xColName, const QString& yColName, int from = 1, int to = -1);
void setDataCurve(int curve, double start, double end) override;
bool setDataFromTable(Table *t, const QString &xColName,
const QString &yColName, int from = 1,
int to = -1) override;
QString resultFormula(){return d_result_formula;};
QString resultFormula(){return d_result_formula;};
QString formula(){return d_formula;};
virtual void setFormula(const QString&){};
......@@ -92,9 +97,9 @@ class Fit : public Filter
void generateFunction(bool yes, int points = 100);
//! Output string added to the plot as a new legend
virtual QString legendInfo();
QString legendInfo() override;
//! Returns a vector with the fit results
//! Returns a vector with the fit results
double* results(){return d_results;};
//! Returns a vector with the standard deviations of the results
......
......@@ -62,13 +62,13 @@ public:
void setSrcTables(QList<MdiSubWindow*> tables);
protected:
void closeEvent (QCloseEvent * e );
void closeEvent(QCloseEvent *e) override;
void initFitPage();
void initEditPage();
void initAdvancedPage();
private slots:
void accept();
void accept() override;
//! Clears the function editor, the parameter names and the function name
void resetFunction();
void showFitPage();
......
......@@ -39,13 +39,14 @@ class FitModelHandler : public QXmlDefaultHandler
public:
explicit FitModelHandler(Fit *fit);
bool startElement(const QString &namespaceURI, const QString &localName,
const QString &qName, const QXmlAttributes &attributes);
bool endElement(const QString &namespaceURI, const QString &localName,
const QString &qName);
bool characters(const QString &str);
bool fatalError(const QXmlParseException &){return false;};
QString errorString() const;
bool startElement(const QString &namespaceURI, const QString &localName,
const QString &qName,
const QXmlAttributes &attributes) override;
bool endElement(const QString &namespaceURI, const QString &localName,
const QString &qName) override;
bool characters(const QString &str) override;
bool fatalError(const QXmlParseException &) override { return false; };
QString errorString() const override;
private:
Fit* d_fit;
......
......@@ -16,13 +16,13 @@ class FloatingWindow: public QMainWindow
Q_OBJECT
public:
FloatingWindow(ApplicationWindow* appWindow, Qt::WindowFlags f = 0);
~FloatingWindow();
~FloatingWindow() override;
void setStaysOnTopFlag();
void removeStaysOnTopFlag();
MdiSubWindow* mdiSubWindow() const;
void setMdiSubWindow(MdiSubWindow* sw);
void removeMdiSubWindow();
virtual QSize minimumSizeHint () const;
QSize minimumSizeHint() const override;
public slots:
void dragMousePress(QPoint);
......@@ -33,8 +33,8 @@ protected:
void setWidget(QWidget* w);
QWidget* widget() const;
bool event(QEvent *ev);
void moveEvent(QMoveEvent *ev);
bool event(QEvent *ev) override;
void moveEvent(QMoveEvent *ev) override;
private:
......
......@@ -168,9 +168,9 @@ public:
enum {RTTI = 1001};
void setActive( bool o );
void cancelRename(int){return;};
void cancelRename(int) override { return; };
virtual int rtti() const {return (int)RTTI;};
int rtti() const override { return (int)RTTI; };
Folder *folder() { return myFolder; };
......@@ -204,15 +204,17 @@ protected slots:
void expandedItem(Q3ListViewItem *item);
protected:
void startDrag();
void contentsDropEvent( QDropEvent *e );
void contentsMouseMoveEvent( QMouseEvent *e );
void contentsMousePressEvent( QMouseEvent *e );
void contentsMouseDoubleClickEvent( QMouseEvent* e );
void keyPressEvent ( QKeyEvent * e );
void contentsMouseReleaseEvent( QMouseEvent *){mousePressed = false;};
void enterEvent(QEvent *){mousePressed = false;};
void startDrag() override;
void contentsDropEvent(QDropEvent *e) override;
void contentsMouseMoveEvent(QMouseEvent *e) override;
void contentsMousePressEvent(QMouseEvent *e) override;
void contentsMouseDoubleClickEvent(QMouseEvent *e) override;
void keyPressEvent(QKeyEvent *e) override;
void contentsMouseReleaseEvent(QMouseEvent *) override {
mousePressed = false;
};
void enterEvent(QEvent *) override { mousePressed = false; };
signals:
void dragItems(QList<Q3ListViewItem *> items);
......
......@@ -53,11 +53,13 @@ public:
FunctionCurve(const Mantid::API::IFunction* fun,
const QString& wsName, int wsIndex = 0, const QString& name = QString());
FunctionCurve(const FunctionCurve& c);
~FunctionCurve();
~FunctionCurve() override;
PlotCurve* clone(const Graph*)const{return new FunctionCurve(*this);}
PlotCurve *clone(const Graph *) const override {
return new FunctionCurve(*this);
}
double startRange(){return d_from;};
double startRange(){return d_from;};
double endRange(){return d_to;};
void setRange(double from, double to);
......@@ -86,7 +88,9 @@ public:
void loadMantidData(boost::shared_ptr<const Mantid::API::MatrixWorkspace> ws, size_t wi);
/// No error bars on this curve: Always return an empty list.
QList<ErrorBarSettings *> errorBarSettingsList() const {return QList<ErrorBarSettings*>();}
QList<ErrorBarSettings *> errorBarSettingsList() const override {
return QList<ErrorBarSettings *>();
}
/// returns identifier where this curve plots a IFunction
const Mantid::API::IFunction* getIFunctionIdentifier() const {return m_identifier;};
......
......@@ -79,8 +79,8 @@ protected slots:
void raiseWidget(int index);
public slots:
void accept();
void acceptFunction();
void accept() override;
void acceptFunction();
void acceptParametric();
void acceptPolar();
void setCurveToModify(Graph *g, int curve);
......
......@@ -156,7 +156,7 @@ class Graph : public QWidget
public:
Graph (int x = 0, int y = 0, int width = 500, int height = 400, QWidget* parent=0, Qt::WFlags f=0);
~Graph();
~Graph() override;
enum Ticks{NoTicks = 0, Out = 1, InOut = 2, In = 3};
enum MarkerType{None = -1, Text = 0, Arrow = 1, Image = 2};
......@@ -368,10 +368,10 @@ public slots:
//! \name Event Handlers
//@{
void contextMenuEvent(QContextMenuEvent *);
void closeEvent(QCloseEvent *e);
bool focusNextPrevChild ( bool next );
void hideEvent(QHideEvent* e);
void contextMenuEvent(QContextMenuEvent *) override;
void closeEvent(QCloseEvent *e) override;
bool focusNextPrevChild(bool next) override;
void hideEvent(QHideEvent *e) override;
//@}
//! Set axis scale
......@@ -700,7 +700,7 @@ public slots:
//@{
bool ignoresResizeEvents(){return ignoreResize;};
void setIgnoreResizeEvents(bool ok){ignoreResize=ok;};
void resizeEvent(QResizeEvent *e);
void resizeEvent(QResizeEvent *e) override;
void scaleFonts(double factor);
//@}
......
......@@ -65,9 +65,9 @@ class Graph3D: public MdiSubWindow, public Mantid::IProjectSerialisable
public:
Graph3D (const QString& label, QWidget* parent, const char* name=0, Qt::WFlags f=0);
~Graph3D();
~Graph3D() override;
enum PlotType{Scatter = 0, Trajectory = 1, Bars = 2, Ribbon = 3};
enum PlotType{Scatter = 0, Trajectory = 1, Bars = 2, Ribbon = 3};
enum PointStyle{None = 0, Dots = 1, VerticalBars = 2, HairCross = 3, Cones = 4};
public slots:
......@@ -116,9 +116,9 @@ public slots:
//! \name Event Handlers
//@{
bool eventFilter(QObject *object, QEvent *e);
void resizeEvent (QResizeEvent *);
void scaleFonts(double factor);
bool eventFilter(QObject *object, QEvent *e) override;
void resizeEvent(QResizeEvent *) override;
void scaleFonts(double factor);
void setIgnoreFonts(bool ok){ignoreFonts = ok;};
//@}
......@@ -239,17 +239,18 @@ public slots:
Qwt3D::FLOORSTYLE floorStyle();
Qwt3D::COORDSTYLE coordStyle();
void print();
void copyImage();
void print() override;
void copyImage();
void exportImage(const QString& fileName, int quality = 100, bool transparent = false);
void exportPDF(const QString& fileName);
void exportPDF(const QString &fileName) override;
void exportVector(const QString& fileName);
void exportToFile(const QString& fileName);
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;
void zoomChanged(double);
void zoomChanged(double);
void rotationChanged(double, double, double);
void scaleChanged(double, double, double);
void shiftChanged(double, double, double);
......@@ -403,9 +404,9 @@ class UserParametricSurface : public ParametricSurface
public:
UserParametricSurface(const QString& xFormula, const QString& yFormula,
const QString& zFormula, SurfacePlot& pw);
Triple operator()(double u, double v);
Triple operator()(double u, double v) override;
unsigned int rows(){return d_rows;};
unsigned int rows(){return d_rows;};
unsigned int columns(){return d_columns;};
void setMesh (unsigned int columns, unsigned int rows);
......
......@@ -61,8 +61,9 @@ public:
std::string saveToString();
private:
void draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) const;
void drawLines(QPainter *painter, const QRect &rect, Qt::Orientation orientation, const QwtScaleMap &map,
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &rect) const override;
void drawLines(QPainter *painter, const QRect &rect, Qt::Orientation orientation, const QwtScaleMap &map,
const QwtValueList &values) const;
QPen d_maj_pen_y;
......
......@@ -44,7 +44,7 @@ class GridDetails: public QWidget
Q_OBJECT
public:
GridDetails(ApplicationWindow* app, Graph* graph, int alignment, QWidget *parent = 0); // populate and fill in with existing data
virtual ~GridDetails();
~GridDetails() override;
void initWidgets();
bool modified(){return m_modified;}
void apply(Grid *grid, bool antialias, bool multirun = false);
......
......@@ -46,8 +46,8 @@ public:
void setSize(const QSize& size);
protected slots:
void accept();
void update();
void accept() override;
void update();
void adjustHeight(int width);
void adjustWidth(int height);
......
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