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

Find most cases of -Wsuggest-override in MantidPlot.

parent 08ea4369
......@@ -83,8 +83,7 @@ public:
m_widget = w;
m_widget->setParent(this); // I am not sure about this
}
~MdiSubWindowParent_t()
{
~MdiSubWindowParent_t() override {
//std::cerr << "MdiSubWindowParent_t deleted\n";
}
QWidget* widget() {return m_widget;}
......@@ -187,14 +186,14 @@ public slots:
* Ask the user "delete, hide, or cancel?" if the
* "ask on close" flag is set.
*/
void closeEvent( QCloseEvent *);
void resizeEvent( QResizeEvent* );
void closeEvent(QCloseEvent *) override;
void resizeEvent(QResizeEvent *) override;
//! Toggle the "ask on close" flag
void confirmClose(bool ask);
//! Filters other object's events (customizes title bar's context menu)
bool eventFilter(QObject *object, QEvent *e);
bool eventFilter(QObject *object, QEvent *e) override;
FloatingWindow* getFloatingWindow() const;
QMdiSubWindow* getDockedWindow() const;
......@@ -227,7 +226,7 @@ public slots:
void show();
void resize(int w, int h);
void resize(const QSize& size);
QSize sizeHint() const;
QSize sizeHint() const override;
/// Focus on the window
void setFocus();
......@@ -278,7 +277,7 @@ signals:
protected:
//! Catches status changes
virtual void changeEvent(QEvent *event);
void changeEvent(QEvent *event) override;
private:
//! Used to parse ASCII files with carriage return ('\r') endline.
......
......@@ -72,9 +72,9 @@ class MultiLayer: public MdiSubWindow, public Mantid::IProjectSerialisable
public:
MultiLayer (ApplicationWindow* parent = 0, int layers = 1, int rows = 1, int cols = 1, const QString& label = "", const char* name=0, Qt::WFlags f=0);
~MultiLayer();
~MultiLayer() override;
QSize minimumSizeHint() const;
QSize minimumSizeHint() const override;
QList<Graph *> layersList(){return graphsList;};
Graph *layer(int num);
......@@ -98,8 +98,9 @@ public:
void setWaterfallLayout(bool on = true);
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;
public slots:
Graph* addLayer(int x = 0, int y = 0, int width = 0, int height = 0);
......@@ -153,13 +154,13 @@ public slots:
void exportToFile(const QString& fileName);
void exportImage(const QString& fileName, int quality = 100, bool transparent = false);
void exportSVG(const QString& fname);
void exportPDF(const QString& fname);
void exportVector(const QString& fileName, int res = 0, bool color = true,
void exportPDF(const QString &fname) override;
void exportVector(const QString& fileName, int res = 0, bool color = true,
bool keepAspect = true, QPrinter::PageSize pageSize = QPrinter::Custom);
void copyAllLayers();
void print();
void printAllLayers(QPainter *painter);
void print() override;
void printAllLayers(QPainter *painter);
void printActiveLayer();
//@}
......@@ -216,16 +217,16 @@ private:
//! \name Event Handlers
//@{
void closeEvent(QCloseEvent*);
void wheelEvent(QWheelEvent *);
void keyPressEvent(QKeyEvent *);
bool eventFilter(QObject *object, QEvent *);
void releaseLayer();
void closeEvent(QCloseEvent *) override;
void wheelEvent(QWheelEvent *) override;
void keyPressEvent(QKeyEvent *) override;
bool eventFilter(QObject *object, QEvent *) override;
void releaseLayer();
void resizeLayers(QResizeEvent *re);
bool focusNextPrevChild ( bool next );
void dragEnterEvent( QDragEnterEvent * event );
void dropEvent( QDropEvent * event );
//@}
bool focusNextPrevChild(bool next) override;
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
//@}
void removeLayerSelectionFrame();
......@@ -262,8 +263,8 @@ public:
static int btnSize(){return 20;};
protected:
void mousePressEvent( QMouseEvent * );
void mouseDoubleClickEvent ( QMouseEvent * );
void mousePressEvent(QMouseEvent *) override;
void mouseDoubleClickEvent(QMouseEvent *) override;
signals:
void showCurvesDialog();
......
......@@ -52,22 +52,22 @@ class MultiPeakFit : public Fit
static QStringList generateExplanationList(int order);
//! Used by the GaussFit and LorentzFit derived classes to calculate initial values for the parameters
void guessInitialValues();
void guessInitialValues() override;
virtual double eval(double *par, double x);
double evalPeak(double *par, double x, int peak);
double eval(double *par, double x) override;
double evalPeak(double *par, double x, int peak);
private:
void init(int);
QString logFitInfo(int iterations, int status);
void generateFitCurve();
static QString peakFormula(int peakIndex, PeakProfile profile);
QString logFitInfo(int iterations, int status) override;
void generateFitCurve() override;
static QString peakFormula(int peakIndex, PeakProfile profile);
//! Inserts a peak function curve into the plot
void insertPeakFunctionCurve(double *x, double *y, int peak);
void customizeFitResults();
void customizeFitResults() override;
//! Number of peaks
//! Number of peaks
int d_peaks;
//! Tells weather the peak curves should be displayed together with the best line fit.
......@@ -118,11 +118,11 @@ class GaussAmpFit : public Fit
GaussAmpFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
GaussAmpFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 0, int endRow = -1);
void guessInitialValues();
double eval(double *par, double x);
void guessInitialValues() override;
double eval(double *par, double x) override;
private:
private:
void init();
void calculateFitCurveData(double *X, double *Y);
void calculateFitCurveData(double *X, double *Y) override;
};
#endif
......@@ -50,10 +50,12 @@ class MultiPeakFitTool : public QObject, public PlotToolInterface
Q_OBJECT
public:
MultiPeakFitTool(Graph *graph, ApplicationWindow *app, MultiPeakFit::PeakProfile profile, int num_peaks, const QObject *status_target, const char *status_slot);
virtual ~MultiPeakFitTool();
~MultiPeakFitTool() override;
virtual int rtti() const {return PlotToolInterface::Rtti_MultiPeakFitTool;};
signals:
int rtti() const override {
return PlotToolInterface::Rtti_MultiPeakFitTool;
};
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.
......
......@@ -62,7 +62,7 @@ public:
/// Constructor
MultiTabScriptInterpreter(ScriptingEnv *env, QWidget *parent);
/// Destructor
~MultiTabScriptInterpreter();
~MultiTabScriptInterpreter() override;
/// Current interpreter
ScriptFileInterpreter *currentInterpreter();
......@@ -208,9 +208,9 @@ private slots:
private:
/// A context menu event for the tab widget itself
void contextMenuEvent(QContextMenuEvent *event);
void contextMenuEvent(QContextMenuEvent *event) override;
/// A custom defined event handler
void customEvent(QEvent *event);
void customEvent(QEvent *event) override;
/// Open a script
void open(bool newtab, const QString &filename = QString());
/// Sets the tab title & tooltip from the filename
......
......@@ -41,13 +41,13 @@ class NonLinearFit : public Fit
NonLinearFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
NonLinearFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1);
double eval(double *par, double x);
double eval(double *par, double x) override;
virtual void setParametersList(const QStringList& lst);
virtual void setFormula(const QString& s);
void setParametersList(const QStringList &lst) override;
void setFormula(const QString &s) override;
private:
void calculateFitCurveData(double *X, double *Y);
void init();
private:
void calculateFitCurveData(double *X, double *Y) override;
void init();
};
#endif
......@@ -46,10 +46,11 @@ class Note: public MdiSubWindow, public Mantid::IProjectSerialisable
public:
Note(const QString& label, QWidget* parent, const QString& name = QString(), Qt::WFlags f=0);
~Note(){};
~Note() override{};
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 setName(const QString& name);
......@@ -61,8 +62,8 @@ public slots:
QString text() { return te->text(); }
void setText(const QString &s) { te->setText(s); }
void print();
void exportPDF(const QString& fileName);
void print() override;
void exportPDF(const QString &fileName) override;
QString exportASCII(const QString &filename=QString::null);
private:
......
......@@ -45,7 +45,7 @@ class OpenProjectDialog : public ExtensibleFileDialog
QComboBox *d_open_mode;
protected slots:
void closeEvent(QCloseEvent* );
void closeEvent(QCloseEvent *) override;
//! Update which options are visible and enabled based on the output format.
void updateAdvancedOptions (const QString &filter);
};
......
......@@ -44,7 +44,8 @@ class Grid;
struct Detacher : public QObject
{
explicit Detacher(QwtPlotItem *plotItem);
~Detacher();
~Detacher() override;
private:
Detacher();
QwtPlotItem *m_plotItem;
......@@ -97,8 +98,10 @@ public:
const QColor & paletteBackgroundColor() const;
using QwtPlot::print; // Avoid Intel compiler warning
void print(QPainter *, const QRect &rect, const QwtPlotPrintFilter & = QwtPlotPrintFilter()) const;
void updateLayout();
void
print(QPainter *, const QRect &rect,
const QwtPlotPrintFilter & = QwtPlotPrintFilter()) const override;
void updateLayout() override;
void updateCurveLabels();
// pass through method that is public on the base class in later qwt versions
......@@ -112,22 +115,24 @@ signals:
void dragMouseMove(QPoint);
protected:
void showEvent (QShowEvent * event);
void showEvent(QShowEvent *event) override;
void printFrame(QPainter *painter, const QRect &rect) const;
// 'Dummy' QRect argument inserted into printCanvas method to avoid Intel
// compiler warning (about printCanvas signature not matching that in base class)
void printCanvas(QPainter *painter, const QRect&, const QRect &canvasRect,
const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const;
virtual void drawItems (QPainter *painter, const QRect &rect,
const QwtScaleMap map[axisCnt], const QwtPlotPrintFilter &pfilter) const;
void drawInwardTicks(QPainter *painter, const QRect &rect,
void printCanvas(QPainter *painter, const QRect &, const QRect &canvasRect,
const QwtScaleMap map[axisCnt],
const QwtPlotPrintFilter &pfilter) const override;
void drawItems(QPainter *painter, const QRect &rect,
const QwtScaleMap map[axisCnt],
const QwtPlotPrintFilter &pfilter) const override;
void drawInwardTicks(QPainter *painter, const QRect &rect,
const QwtScaleMap&map, int axis, bool min, bool maj) const;
void drawBreak(QPainter *painter, const QRect &rect, const QwtScaleMap &map, int axis) const;
bool eventFilter(QObject *obj, QEvent *ev);
bool eventFilter(QObject *obj, QEvent *ev) override;
Grid *d_grid;
Grid *d_grid;
QMap<int, QwtPlotItem*> d_curves;
QMap<int, QwtPlotMarker*> d_markers;
......
......@@ -64,8 +64,8 @@ public:
void showGeneralTab();
private slots:
void accept();
bool updatePlot();
void accept() override;
bool updatePlot();
void pickTitleFont();
void viewAxisOptions(int axis);
......
......@@ -93,14 +93,13 @@ signals:
void forgetMe();
protected:
virtual void drawCurve(QPainter *p, int style, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, int from, int to) const;
void drawCurve(QPainter *p, int style, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, int from, int to) const override;
void drawSideLines(QPainter *p, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, int from, int to) const;
virtual void drawSymbols(QPainter *p, const QwtSymbol &,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
int from, int to) const;
void drawSymbols(QPainter *p, const QwtSymbol &, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, int from, int to) const override;
void computeWaterfallOffsets();
......@@ -121,7 +120,7 @@ public:
DataCurve(const DataCurve &c);
void clone(DataCurve *c);
PlotCurve *clone(const Graph *) const;
PlotCurve *clone(const Graph *) const override;
QString saveToString();
......@@ -193,7 +192,7 @@ public:
QList<DataCurve *> errorBarsList() const { return d_error_bars; };
/// Returns a list of error bar settings for each set of error bars associated
/// to this curve
virtual QList<ErrorBarSettings *> errorBarSettingsList() const;
QList<ErrorBarSettings *> errorBarSettingsList() const override;
//! Adds a single error bars curve to the list of attached error bars.
void addErrorBars(DataCurve *c) {
if (c)
......@@ -206,7 +205,7 @@ public:
//! Clears the list of attached text labels.
void clearLabels();
void setVisible(bool on);
void setVisible(bool on) override;
bool selectedLabels(const QPoint &pos);
bool hasSelectedLabels() const;
......@@ -270,7 +269,7 @@ public:
protected:
//! Does the actual drawing; see QwtPlotItem::draw.
void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &r) const;
const QRect &r) const override;
int d_index;
double d_angle;
......
......@@ -138,7 +138,7 @@ protected slots:
private:
void setMultiLayer(MultiLayer *ml);
int labelsAlignment();
void closeEvent(QCloseEvent* e);
void closeEvent(QCloseEvent *e) override;
void clearTabWidget();
void initAxesPage();
......@@ -160,7 +160,7 @@ private:
void initPrintPage();
void initLabelsPage();
void initContourLinesPage();
void contextMenuEvent(QContextMenuEvent *e);
void contextMenuEvent(QContextMenuEvent *e) override;
void updateContourLevelsDisplay(Spectrogram *sp);
void showAllLabelControls(bool show = true);
......
......@@ -103,8 +103,8 @@ public slots:
//! Add column as Y error
void addYErrCol();
//! Accept settings, close the dialog
void accept();
//! Add column as Z
void accept() override;
//! Add column as Z
void addZCol();
private:
......@@ -112,7 +112,7 @@ private:
void plot3DRibbon(const QStringList& lst);
//! Display a warning that a new curve must be added first before the selection of the columns
bool noCurves();
QSize sizeHint() const;
QSize sizeHint() const override;
signals:
//! Emitted when new plots need to be created
......
......@@ -42,12 +42,14 @@ class PluginFit : public Fit
PluginFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1);
bool load(const QString& pluginName);
double eval(double *par, double x){return f_eval(x, par);};
double eval(double *par, double x) override {
return f_eval(x, par);
};
private:
private:
void init();
typedef double (*fitFunctionEval)(double, double *);
void calculateFitCurveData(double *X, double *Y);
fitFunctionEval f_eval;
void calculateFitCurveData(double *X, double *Y) override;
fitFunctionEval f_eval;
};
#endif
......@@ -41,22 +41,22 @@ class PolynomialFit : public Fit
PolynomialFit(ApplicationWindow *parent, Graph *g, QString& curveTitle, double start, double end, int order = 2, bool legend = false);
PolynomialFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1, int order = 2, bool legend = false);
virtual QString legendInfo();
void fit();
QString legendInfo() override;
void fit() override;
int order(){return d_order;};
int order(){return d_order;};
void setOrder(int order);
static QString generateFormula(int order);
static QStringList generateParameterList(int order);
virtual double eval(double *par, double x);
double eval(double *par, double x) override;
private:
private:
void init();
void calculateFitCurveData(double *X, double *Y);
void calculateFitCurveData(double *X, double *Y) override;
int d_order;
int d_order;
bool show_legend;
};
......@@ -70,12 +70,14 @@ class LinearFit : public Fit
LinearFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
LinearFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1);
void fit();
virtual double eval(double *par, double x){return par[0] + par[1]*x;};
void fit() override;
double eval(double *par, double x) override {
return par[0] + par[1] * x;
};
private:
private:
void init();
void calculateFitCurveData(double *X, double *Y);
void calculateFitCurveData(double *X, double *Y) override;
};
class LinearSlopeFit : public Fit
......@@ -88,11 +90,13 @@ class LinearSlopeFit : public Fit
LinearSlopeFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
LinearSlopeFit(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int startRow = 1, int endRow = -1);
void fit();
virtual double eval(double *par, double x){return par[0]*x;};
void fit() override;
double eval(double *par, double x) override {
return par[0] * x;
};
private:
private:
void init();
void calculateFitCurveData(double *X, double *Y);
void calculateFitCurveData(double *X, double *Y) override;
};
#endif
......@@ -55,10 +55,10 @@ public:
PythonScript(PythonScripting *env, const QString &name, const InteractionType interact,
QObject * context);
/// Destructor
~PythonScript();
~PythonScript() override;
/// Set the identifier of the script. If empty, set a default so that the code object behaves correctly
void setIdentifier(const QString & name);
void setIdentifier(const QString &name) override;
/// Create a PyObject that wraps this C++ instance
PyObject * createSipInstanceFromMe();
......@@ -71,7 +71,7 @@ public:
/// Simulate file-like object (required for colorama)
inline bool closed() { return false; }
/// Is the given code complete
bool compilesToCompleteStatement(const QString & code) const;
bool compilesToCompleteStatement(const QString &code) const override;
// -------------------------- Line number tracing ---------------------------
/// Emits a signal from this object indicating the current line number of the
......@@ -81,7 +81,7 @@ public:
void sendLineChangeSignal(int lineNo, bool error);
/// Create a list of keywords for the code completion API
void generateAutoCompleteList();
void generateAutoCompleteList() override;
/// Special handle for syntax errors as they have no traceback
QString constructSyntaxErrorStr(PyObject *syntaxError);
......@@ -90,15 +90,15 @@ public:
bool root=true);
/// Set the name of the passed object so that Python can refer to it
bool setQObject(QObject *val, const char *name);
bool setQObject(QObject *val, const char *name) override;
/// Set the name of the integer so that Python can refer to it
bool setInt(int val, const char* name);
bool setInt(int val, const char *name) override;
/// Set the name of the double so that Python can refer to it
bool setDouble(double val, const char* name);
bool setDouble(double val, const char *name) override;
/// Set the context for this script
void setContext(QObject *context);
void setContext(QObject *context) override;
/// Resets the local dictionary to the defaults
void clearLocals();
void clearLocals() override;
private:
/// Helper class to ensure the sys.path variable is updated correctly
......@@ -158,13 +158,13 @@ private:
// --------------------------- Script compilation/execution -----------------------------------
/// Compile the code, returning true if it was successful, false otherwise
bool compileImpl();
bool compileImpl() override;
/// Evaluate the current code and return a result as a QVariant
QVariant evaluateImpl();
QVariant evaluateImpl() override;
/// Execute the current code and return a boolean indicating success/failure
bool executeImpl();
bool executeImpl() override;
/// Request that this script be aborted
void abortImpl();
void abortImpl() override;
/// Get the value of the Python thread ID when a script is executed
long getThreadID();
......@@ -180,13 +180,15 @@ private:
// ---------------------------- Variable reference ---------------------------------------------
/// Listen to add notifications from the ADS
void addHandle(const std::string& wsName, const Mantid::API::Workspace_sptr ws);
void addHandle(const std::string &wsName,
const Mantid::API::Workspace_sptr ws) override;
/// Listen to add/replace notifications from the ADS
void afterReplaceHandle(const std::string& wsName,const Mantid::API::Workspace_sptr ws);
void afterReplaceHandle(const std::string &wsName,
const Mantid::API::Workspace_sptr ws) override;
/// Listen to delete notifications
void postDeleteHandle(const std::string& wsName);
void postDeleteHandle(const std::string &wsName) override;
/// Listen to ADS clear notifications
void clearADSHandle();
void clearADSHandle() override;
/// Add/update a Python reference to the given workspace
void addPythonReference(const std::string& wsName,const Mantid::API::Workspace_sptr ws);
/// Delete a Python reference to the given workspace name
......