# HG changeset patch # User Chris Cannam # Date 1543240347 0 # Node ID a18e78b9c78bdfbcf7d7f899f634eebe8bed2d9e # Parent 4c359c2b220cfb1d0912f0d4fceb878591994eeb Use override throughout diff -r 4c359c2b220c -r a18e78b9c78b layer/Colour3DPlotLayer.h --- a/layer/Colour3DPlotLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/Colour3DPlotLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -46,48 +46,48 @@ Colour3DPlotLayer(); ~Colour3DPlotLayer(); - virtual const ZoomConstraint *getZoomConstraint() const { + const ZoomConstraint *getZoomConstraint() const override { return m_model ? m_model->getZoomConstraint() : 0; } - virtual const Model *getModel() const { return m_model; } - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; - virtual void setSynchronousPainting(bool synchronous); + const Model *getModel() const override { return m_model; } + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; + void setSynchronousPainting(bool synchronous) override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; - virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; + int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override; + void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void setLayerDormant(const LayerGeometryProvider *v, bool dormant); + void setLayerDormant(const LayerGeometryProvider *v, bool dormant) override; - virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; + bool isLayerScrollable(const LayerGeometryProvider *v) const override; - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { return ColourHasMeaningfulValue; } void setModel(const DenseThreeDimensionalModel *model); - virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } + int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } - virtual PropertyList getProperties() const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual QString getPropertyIconName(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual QString getPropertyValueIconName(const PropertyName &, - int value) const; - virtual RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const; - virtual void setProperty(const PropertyName &, int value); - virtual void setProperties(const QXmlAttributes &); + PropertyList getProperties() const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyLabel(const PropertyName &) const override; + QString getPropertyIconName(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + QString getPropertyValueIconName(const PropertyName &, + int value) const override; + RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override; + void setProperty(const PropertyName &, int value) override; + void setProperties(const QXmlAttributes &) override; void setColourScale(ColourScaleType); ColourScaleType getColourScale() const { return m_colourScale; } @@ -129,24 +129,24 @@ void setSmooth(bool i); bool getSmooth() const; - virtual bool getValueExtents(double &min, double &max, - bool &logarithmic, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &logarithmic, QString &unit) const override; - virtual bool getDisplayExtents(double &min, double &max) const; - virtual bool setDisplayExtents(double min, double max); + bool getDisplayExtents(double &min, double &max) const override; + bool setDisplayExtents(double min, double max) override; - virtual bool getYScaleValue(const LayerGeometryProvider *, int /* y */, - double &/* value */, QString &/* unit */) const; + bool getYScaleValue(const LayerGeometryProvider *, int /* y */, + double &/* value */, QString &/* unit */) const override; - virtual int getVerticalZoomSteps(int &defaultStep) const; - virtual int getCurrentVerticalZoomStep() const; - virtual void setVerticalZoomStep(int); - virtual RangeMapper *getNewVerticalZoomRangeMapper() const; + int getVerticalZoomSteps(int &defaultStep) const override; + int getCurrentVerticalZoomStep() const override; + void setVerticalZoomStep(int) override; + RangeMapper *getNewVerticalZoomRangeMapper() const override; - virtual const Model *getSliceableModel() const { return m_model; } + const Model *getSliceableModel() const override { return m_model; } - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; protected slots: void cacheInvalid(); @@ -203,7 +203,7 @@ * and the vertical scale is the usual way up). Bin number may be * fractional, to obtain a position part-way through a bin. */ - double getYForBin(const LayerGeometryProvider *, double bin) const; + double getYForBin(const LayerGeometryProvider *, double bin) const override; /** * Return the bin number, possibly fractional, at the given y @@ -211,7 +211,7 @@ * at which the bins "start" (i.e. the bottom of the visible bin, * if the vertical scale is the usual way up). */ - double getBinForY(const LayerGeometryProvider *, double y) const; + double getBinForY(const LayerGeometryProvider *, double y) const override; int getColourScaleWidth(QPainter &) const; diff -r 4c359c2b220c -r a18e78b9c78b layer/FlexiNoteLayer.h --- a/layer/FlexiNoteLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/FlexiNoteLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -38,63 +38,63 @@ public: FlexiNoteLayer(); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; - virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; + int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override; + void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); + void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; + void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); + void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); + void editStart(LayerGeometryProvider *v, QMouseEvent *) override; + void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void splitStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void splitEnd(LayerGeometryProvider *v, QMouseEvent *); + void splitStart(LayerGeometryProvider *v, QMouseEvent *) override; + void splitEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void addNote(LayerGeometryProvider *v, QMouseEvent *e); + void addNote(LayerGeometryProvider *v, QMouseEvent *e) override; virtual void mouseMoveEvent(LayerGeometryProvider *v, QMouseEvent *); - virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *); + bool editOpen(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void moveSelection(Selection s, sv_frame_t newStartFrame); - virtual void resizeSelection(Selection s, Selection newSize); - virtual void deleteSelection(Selection s); + void moveSelection(Selection s, sv_frame_t newStartFrame) override; + void resizeSelection(Selection s, Selection newSize) override; + void deleteSelection(Selection s) override; virtual void deleteSelectionInclusive(Selection s); - virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); - virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, - bool interactive); + void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; + bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, + bool interactive) override; void splitNotesAt(LayerGeometryProvider *v, sv_frame_t frame); void snapSelectedNotesToPitchTrack(LayerGeometryProvider *v, Selection s); void mergeNotes(LayerGeometryProvider *v, Selection s, bool inclusive); - virtual const Model *getModel() const { return m_model; } + const Model *getModel() const override { return m_model; } void setModel(FlexiNoteModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + void setProperty(const PropertyName &, int value) override; enum VerticalScale { AutoAlignScale, @@ -116,22 +116,22 @@ void setVerticalScale(VerticalScale scale); VerticalScale getVerticalScale() const { return m_verticalScale; } - virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; + bool isLayerScrollable(const LayerGeometryProvider *v) const override; - virtual bool isLayerEditable() const { return true; } + bool isLayerEditable() const override { return true; } - virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } + int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } - virtual bool getValueExtents(double &min, double &max, - bool &log, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &log, QString &unit) const override; - virtual bool getDisplayExtents(double &min, double &max) const; - virtual bool setDisplayExtents(double min, double max); + bool getDisplayExtents(double &min, double &max) const override; + bool setDisplayExtents(double min, double max) override; - virtual int getVerticalZoomSteps(int &defaultStep) const; - virtual int getCurrentVerticalZoomStep() const; - virtual void setVerticalZoomStep(int); - virtual RangeMapper *getNewVerticalZoomRangeMapper() const; + int getVerticalZoomSteps(int &defaultStep) const override; + int getCurrentVerticalZoomStep() const override; + void setVerticalZoomStep(int) override; + RangeMapper *getNewVerticalZoomRangeMapper() const override; /** * Add a note-on. Used when recording MIDI "live". The note will @@ -151,17 +151,17 @@ */ void abandonNoteOns(); - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; void setVerticalRangeToNoteRange(LayerGeometryProvider *v); /// VerticalScaleLayer methods - virtual int getYForValue(LayerGeometryProvider *v, double value) const; - virtual double getValueForY(LayerGeometryProvider *v, int y) const; - virtual QString getScaleUnits() const; + int getYForValue(LayerGeometryProvider *v, double value) const override; + double getValueForY(LayerGeometryProvider *v, int y) const override; + QString getScaleUnits() const override; signals: void reAnalyseRegion(sv_frame_t, sv_frame_t, float, float); @@ -171,7 +171,7 @@ void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const; bool shouldConvertMIDIToHz() const; - virtual int getDefaultColourHint(bool dark, bool &impose); + int getDefaultColourHint(bool dark, bool &impose) override; FlexiNoteModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const; diff -r 4c359c2b220c -r a18e78b9c78b layer/ImageLayer.h --- a/layer/ImageLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/ImageLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -38,65 +38,65 @@ ImageLayer(); virtual ~ImageLayer(); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); + void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; + void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); + void editStart(LayerGeometryProvider *v, QMouseEvent *) override; + void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void moveSelection(Selection s, sv_frame_t newStartFrame); - virtual void resizeSelection(Selection s, Selection newSize); - virtual void deleteSelection(Selection s); + void moveSelection(Selection s, sv_frame_t newStartFrame) override; + void resizeSelection(Selection s, Selection newSize) override; + void deleteSelection(Selection s) override; - virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); - virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, - bool interactive); + void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; + bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, + bool interactive) override; - virtual bool editOpen(LayerGeometryProvider *, QMouseEvent *); // on double-click + bool editOpen(LayerGeometryProvider *, QMouseEvent *) override; // on double-click - virtual const Model *getModel() const { return m_model; } + const Model *getModel() const override { return m_model; } void setModel(ImageModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + void setProperty(const PropertyName &, int value) override; - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { return ColourAbsent; } - virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; + bool isLayerScrollable(const LayerGeometryProvider *v) const override; - virtual bool isLayerEditable() const { return true; } + bool isLayerEditable() const override { return true; } - virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } + int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } - virtual bool getValueExtents(double &min, double &max, - bool &logarithmic, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &logarithmic, QString &unit) const override; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const { return 0; } + int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const override { return 0; } - virtual void setLayerDormant(const LayerGeometryProvider *v, bool dormant); + void setLayerDormant(const LayerGeometryProvider *v, bool dormant) override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; virtual bool addImage(sv_frame_t frame, QString url); // using a command diff -r 4c359c2b220c -r a18e78b9c78b layer/Layer.h --- a/layer/Layer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/Layer.h Mon Nov 26 13:52:27 2018 +0000 @@ -118,9 +118,9 @@ return true; } - virtual QString getPropertyContainerIconName() const; + QString getPropertyContainerIconName() const override; - virtual QString getPropertyContainerName() const { + QString getPropertyContainerName() const override { if (m_presentationName != "") return m_presentationName; else return objectName(); } @@ -366,8 +366,8 @@ * this superclass implementation with extra attributes describing * their particular properties. */ - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; /** * Set the particular properties of a layer (those specific to the @@ -412,7 +412,7 @@ */ virtual bool isLayerDormant(const LayerGeometryProvider *v) const; - virtual PlayParameters *getPlayParameters(); + PlayParameters *getPlayParameters() override; /** * True if this layer will need to place text labels when it is @@ -593,9 +593,9 @@ AddMeasurementRectCommand(Layer *layer, MeasureRect rect) : m_layer(layer), m_rect(rect) { } - virtual QString getName() const; - virtual void execute(); - virtual void unexecute(); + QString getName() const override; + void execute() override; + void unexecute() override; private: Layer *m_layer; @@ -608,9 +608,9 @@ DeleteMeasurementRectCommand(Layer *layer, MeasureRect rect) : m_layer(layer), m_rect(rect) { } - virtual QString getName() const; - virtual void execute(); - virtual void unexecute(); + QString getName() const override; + void execute() override; + void unexecute() override; private: Layer *m_layer; diff -r 4c359c2b220c -r a18e78b9c78b layer/NoteLayer.h --- a/layer/NoteLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/NoteLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -35,51 +35,51 @@ public: NoteLayer(); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; - virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; + int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override; + void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); + void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; + void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); + void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); + void editStart(LayerGeometryProvider *v, QMouseEvent *) override; + void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *); + bool editOpen(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void moveSelection(Selection s, sv_frame_t newStartFrame); - virtual void resizeSelection(Selection s, Selection newSize); - virtual void deleteSelection(Selection s); + void moveSelection(Selection s, sv_frame_t newStartFrame) override; + void resizeSelection(Selection s, Selection newSize) override; + void deleteSelection(Selection s) override; - virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); - virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, - bool interactive); + void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; + bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, + bool interactive) override; - virtual const Model *getModel() const { return m_model; } + const Model *getModel() const override { return m_model; } void setModel(NoteModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + void setProperty(const PropertyName &, int value) override; enum VerticalScale { AutoAlignScale, @@ -91,22 +91,22 @@ void setVerticalScale(VerticalScale scale); VerticalScale getVerticalScale() const { return m_verticalScale; } - virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; + bool isLayerScrollable(const LayerGeometryProvider *v) const override; - virtual bool isLayerEditable() const { return true; } + bool isLayerEditable() const override { return true; } - virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } + int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } - virtual bool getValueExtents(double &min, double &max, - bool &log, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &log, QString &unit) const override; - virtual bool getDisplayExtents(double &min, double &max) const; - virtual bool setDisplayExtents(double min, double max); + bool getDisplayExtents(double &min, double &max) const override; + bool setDisplayExtents(double min, double max) override; - virtual int getVerticalZoomSteps(int &defaultStep) const; - virtual int getCurrentVerticalZoomStep() const; - virtual void setVerticalZoomStep(int); - virtual RangeMapper *getNewVerticalZoomRangeMapper() const; + int getVerticalZoomSteps(int &defaultStep) const override; + int getCurrentVerticalZoomStep() const override; + void setVerticalZoomStep(int) override; + RangeMapper *getNewVerticalZoomRangeMapper() const override; /** * Add a note-on. Used when recording MIDI "live". The note will @@ -126,21 +126,21 @@ */ void abandonNoteOns(); - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; /// VerticalScaleLayer methods - virtual int getYForValue(LayerGeometryProvider *v, double value) const; - virtual double getValueForY(LayerGeometryProvider *v, int y) const; - virtual QString getScaleUnits() const; + int getYForValue(LayerGeometryProvider *v, double value) const override; + double getValueForY(LayerGeometryProvider *v, int y) const override; + QString getScaleUnits() const override; protected: void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const; bool shouldConvertMIDIToHz() const; - virtual int getDefaultColourHint(bool dark, bool &impose); + int getDefaultColourHint(bool dark, bool &impose) override; NoteModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const; diff -r 4c359c2b220c -r a18e78b9c78b layer/RegionLayer.h --- a/layer/RegionLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/RegionLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -39,55 +39,55 @@ public: RegionLayer(); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; - virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; + int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override; + void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; - virtual QString getLabelPreceding(sv_frame_t) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; + QString getLabelPreceding(sv_frame_t) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; - virtual bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, + SnapType snap) const override; + bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); + void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; + void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); + void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); + void editStart(LayerGeometryProvider *v, QMouseEvent *) override; + void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *); + bool editOpen(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void moveSelection(Selection s, sv_frame_t newStartFrame); - virtual void resizeSelection(Selection s, Selection newSize); - virtual void deleteSelection(Selection s); + void moveSelection(Selection s, sv_frame_t newStartFrame) override; + void resizeSelection(Selection s, Selection newSize) override; + void deleteSelection(Selection s) override; - virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); - virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, - bool interactive); + void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; + bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, + bool interactive) override; - virtual const Model *getModel() const { return m_model; } + const Model *getModel() const override { return m_model; } void setModel(RegionModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + void setProperty(const PropertyName &, int value) override; void setFillColourMap(int); int getFillColourMap() const { return m_colourMap; } @@ -110,27 +110,27 @@ void setPlotStyle(PlotStyle style); PlotStyle getPlotStyle() const { return m_plotStyle; } - virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; + bool isLayerScrollable(const LayerGeometryProvider *v) const override; - virtual bool isLayerEditable() const { return true; } + bool isLayerEditable() const override { return true; } - virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } + int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } - virtual bool getValueExtents(double &min, double &max, - bool &log, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &log, QString &unit) const override; - virtual bool getDisplayExtents(double &min, double &max) const; + bool getDisplayExtents(double &min, double &max) const override; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; /// VerticalScaleLayer and ColourScaleLayer methods - int getYForValue(LayerGeometryProvider *v, double value) const; - double getValueForY(LayerGeometryProvider *v, int y) const; - virtual QString getScaleUnits() const; - QColor getColourForValue(LayerGeometryProvider *v, double value) const; + int getYForValue(LayerGeometryProvider *v, double value) const override; + double getValueForY(LayerGeometryProvider *v, int y) const override; + QString getScaleUnits() const override; + QColor getColourForValue(LayerGeometryProvider *v, double value) const override; protected slots: void recalcSpacing(); @@ -139,7 +139,7 @@ double getValueForY(LayerGeometryProvider *v, int y, int avoid) const; void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const; - virtual int getDefaultColourHint(bool dark, bool &impose); + int getDefaultColourHint(bool dark, bool &impose) override; RegionModel::PointList getLocalPoints(LayerGeometryProvider *v, int x) const; diff -r 4c359c2b220c -r a18e78b9c78b layer/ShowLayerCommand.h --- a/layer/ShowLayerCommand.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/ShowLayerCommand.h Mon Nov 26 13:52:27 2018 +0000 @@ -23,13 +23,13 @@ public: ShowLayerCommand(View *view, Layer *layer, bool show, QString commandName) : m_view(view), m_layer(layer), m_show(show), m_name(commandName) { } - void execute() { + void execute() override { m_layer->showLayer(m_view, m_show); } - void unexecute() { + void unexecute() override { m_layer->showLayer(m_view, !m_show); } - QString getName() const { + QString getName() const override { return m_name; } protected: diff -r 4c359c2b220c -r a18e78b9c78b layer/SingleColourLayer.h --- a/layer/SingleColourLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/SingleColourLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -44,32 +44,32 @@ * background, false if it has a light colour on a dark * background. */ - virtual bool hasLightBackground() const; + bool hasLightBackground() const override; /** * Implements Layer::getLayerColourSignificance() */ - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { return ColourDistinguishes; } - virtual QPixmap getLayerPresentationPixmap(QSize size) const; + QPixmap getLayerPresentationPixmap(QSize size) const override; - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override; + void setProperty(const PropertyName &, int value) override; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - virtual void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; virtual void setDefaultColourFor(LayerGeometryProvider *v); diff -r 4c359c2b220c -r a18e78b9c78b layer/SliceLayer.h --- a/layer/SliceLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/SliceLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -32,52 +32,52 @@ SliceLayer(); ~SliceLayer(); - virtual const Model *getModel() const { return 0; } + const Model *getModel() const override { return 0; } void setSliceableModel(const Model *model); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; - virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; + int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override; + void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override; - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { return ColourAndBackgroundSignificant; } - virtual bool hasLightBackground() const; + bool hasLightBackground() const override; - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual QString getPropertyIconName(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const; - virtual void setProperty(const PropertyName &, int value); - virtual void setProperties(const QXmlAttributes &); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + QString getPropertyIconName(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override; + void setProperty(const PropertyName &, int value) override; + void setProperties(const QXmlAttributes &) override; - virtual bool getValueExtents(double &min, double &max, - bool &logarithmic, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &logarithmic, QString &unit) const override; - virtual bool getDisplayExtents(double &min, double &max) const; - virtual bool setDisplayExtents(double min, double max); + bool getDisplayExtents(double &min, double &max) const override; + bool setDisplayExtents(double min, double max) override; - virtual int getVerticalZoomSteps(int &defaultStep) const; - virtual int getCurrentVerticalZoomStep() const; - virtual void setVerticalZoomStep(int); - virtual RangeMapper *getNewVerticalZoomRangeMapper() const; + int getVerticalZoomSteps(int &defaultStep) const override; + int getCurrentVerticalZoomStep() const override; + void setVerticalZoomStep(int) override; + RangeMapper *getNewVerticalZoomRangeMapper() const override; virtual bool hasTimeXAxis() const override { return false; } virtual void zoomToRegion(const LayerGeometryProvider *, QRect) override; - virtual bool isLayerScrollable(const LayerGeometryProvider *) const { return false; } + bool isLayerScrollable(const LayerGeometryProvider *) const override { return false; } enum EnergyScale { LinearScale, MeterScale, dBScale, AbsoluteScale }; @@ -113,8 +113,8 @@ void setNormalize(bool n); bool getNormalize() const; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; public slots: void sliceableModelReplaced(const Model *, const Model *); @@ -153,7 +153,7 @@ virtual float getThresholdDb() const; - virtual int getDefaultColourHint(bool dark, bool &impose); + int getDefaultColourHint(bool dark, bool &impose) override; // Determine how the bins are lined up // horizontally. BinsCentredOnScalePoint means we operate like a diff -r 4c359c2b220c -r a18e78b9c78b layer/SpectrogramLayer.h --- a/layer/SpectrogramLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/SpectrogramLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -59,43 +59,43 @@ SpectrogramLayer(Configuration = FullRangeDb); ~SpectrogramLayer(); - virtual const ZoomConstraint *getZoomConstraint() const { return this; } - virtual const Model *getModel() const { return m_model; } - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; - virtual void setSynchronousPainting(bool synchronous); + const ZoomConstraint *getZoomConstraint() const override { return this; } + const Model *getModel() const override { return m_model; } + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; + void setSynchronousPainting(bool synchronous) override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const; - virtual void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const; + int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const override; + void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const override; - virtual bool getCrosshairExtents(LayerGeometryProvider *, QPainter &, QPoint cursorPos, - std::vector &extents) const; - virtual void paintCrosshairs(LayerGeometryProvider *, QPainter &, QPoint) const; + bool getCrosshairExtents(LayerGeometryProvider *, QPainter &, QPoint cursorPos, + std::vector &extents) const override; + void paintCrosshairs(LayerGeometryProvider *, QPainter &, QPoint) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void measureDoubleClick(LayerGeometryProvider *, QMouseEvent *); + void measureDoubleClick(LayerGeometryProvider *, QMouseEvent *) override; - virtual bool hasLightBackground() const; + bool hasLightBackground() const override; void setModel(const DenseTimeValueModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual QString getPropertyIconName(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual QString getPropertyValueIconName(const PropertyName &, - int value) const; - virtual RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + QString getPropertyIconName(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + QString getPropertyValueIconName(const PropertyName &, + int value) const override; + RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override; + void setProperty(const PropertyName &, int value) override; /** * Specify the channel to use from the source model. @@ -191,13 +191,13 @@ void setColourRotation(int); int getColourRotation() const; - virtual VerticalPosition getPreferredFrameCountPosition() const { + VerticalPosition getPreferredFrameCountPosition() const override { return PositionTop; } - virtual bool isLayerOpaque() const { return true; } + bool isLayerOpaque() const override { return true; } - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { return ColourHasMeaningfulValue; } @@ -205,36 +205,36 @@ double getFrequencyForY(const LayerGeometryProvider *v, int y) const; //!!! VerticalBinLayer methods. Note overlap with get*BinRange() - double getYForBin(const LayerGeometryProvider *, double bin) const; - double getBinForY(const LayerGeometryProvider *, double y) const; + double getYForBin(const LayerGeometryProvider *, double bin) const override; + double getBinForY(const LayerGeometryProvider *, double y) const override; - virtual int getCompletion(LayerGeometryProvider *v) const; - virtual QString getError(LayerGeometryProvider *v) const; + int getCompletion(LayerGeometryProvider *v) const override; + QString getError(LayerGeometryProvider *v) const override; - virtual bool getValueExtents(double &min, double &max, - bool &logarithmic, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &logarithmic, QString &unit) const override; - virtual bool getDisplayExtents(double &min, double &max) const; + bool getDisplayExtents(double &min, double &max) const override; - virtual bool setDisplayExtents(double min, double max); + bool setDisplayExtents(double min, double max) override; - virtual bool getYScaleValue(const LayerGeometryProvider *, int, double &, QString &) const; + bool getYScaleValue(const LayerGeometryProvider *, int, double &, QString &) const override; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; - virtual void setLayerDormant(const LayerGeometryProvider *v, bool dormant); + void setLayerDormant(const LayerGeometryProvider *v, bool dormant) override; - virtual bool isLayerScrollable(const LayerGeometryProvider *) const; + bool isLayerScrollable(const LayerGeometryProvider *) const override; - virtual int getVerticalZoomSteps(int &defaultStep) const; - virtual int getCurrentVerticalZoomStep() const; - virtual void setVerticalZoomStep(int); - virtual RangeMapper *getNewVerticalZoomRangeMapper() const; + int getVerticalZoomSteps(int &defaultStep) const override; + int getCurrentVerticalZoomStep() const override; + void setVerticalZoomStep(int) override; + RangeMapper *getNewVerticalZoomRangeMapper() const override; - virtual const Model *getSliceableModel() const; + const Model *getSliceableModel() const override; protected slots: void cacheInvalid(); @@ -334,10 +334,10 @@ void paintDetailedScalePhase(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; - virtual void updateMeasureRectYCoords(LayerGeometryProvider *v, - const MeasureRect &r) const; - virtual void setMeasureRectYCoord(LayerGeometryProvider *v, - MeasureRect &r, bool start, int y) const; + void updateMeasureRectYCoords(LayerGeometryProvider *v, + const MeasureRect &r) const override; + void setMeasureRectYCoord(LayerGeometryProvider *v, + MeasureRect &r, bool start, int y) const override; }; #endif diff -r 4c359c2b220c -r a18e78b9c78b layer/SpectrumLayer.h --- a/layer/SpectrumLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/SpectrumLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -101,7 +101,7 @@ void setShowPeaks(bool); bool getShowPeaks() const { return m_showPeaks; } - virtual bool needsTextLabelHeight() const { return true; } + bool needsTextLabelHeight() const override { return true; } virtual void toXml(QTextStream &stream, QString indent = "", QString extraAttributes = "") const override; diff -r 4c359c2b220c -r a18e78b9c78b layer/TextLayer.h --- a/layer/TextLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/TextLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -32,69 +32,69 @@ public: TextLayer(); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); + void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; + void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); + void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); + void editStart(LayerGeometryProvider *v, QMouseEvent *) override; + void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void moveSelection(Selection s, sv_frame_t newStartFrame); - virtual void resizeSelection(Selection s, Selection newSize); - virtual void deleteSelection(Selection s); + void moveSelection(Selection s, sv_frame_t newStartFrame) override; + void resizeSelection(Selection s, Selection newSize) override; + void deleteSelection(Selection s) override; - virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); - virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, - bool interactive); + void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; + bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, + bool interactive) override; - virtual bool editOpen(LayerGeometryProvider *, QMouseEvent *); // on double-click + bool editOpen(LayerGeometryProvider *, QMouseEvent *) override; // on double-click - virtual const Model *getModel() const { return m_model; } + const Model *getModel() const override { return m_model; } void setModel(TextModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + void setProperty(const PropertyName &, int value) override; - virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; + bool isLayerScrollable(const LayerGeometryProvider *v) const override; - virtual bool isLayerEditable() const { return true; } + bool isLayerEditable() const override { return true; } - virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } + int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } - virtual bool getValueExtents(double &min, double &max, - bool &logarithmic, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &logarithmic, QString &unit) const override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const { return 0; } + int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const override { return 0; } - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; protected: int getYForHeight(LayerGeometryProvider *v, double height) const; double getHeightForY(LayerGeometryProvider *v, int y) const; - virtual int getDefaultColourHint(bool dark, bool &impose); + int getDefaultColourHint(bool dark, bool &impose) override; TextModel::PointList getLocalPoints(LayerGeometryProvider *v, int x, int y) const; diff -r 4c359c2b220c -r a18e78b9c78b layer/TimeInstantLayer.h --- a/layer/TimeInstantLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/TimeInstantLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -33,48 +33,48 @@ TimeInstantLayer(); virtual ~TimeInstantLayer(); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual QString getLabelPreceding(sv_frame_t) const; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getLabelPreceding(sv_frame_t) const override; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); + void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; + void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); + void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); + void editStart(LayerGeometryProvider *v, QMouseEvent *) override; + void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual bool editOpen(LayerGeometryProvider *, QMouseEvent *); + bool editOpen(LayerGeometryProvider *, QMouseEvent *) override; - virtual void moveSelection(Selection s, sv_frame_t newStartFrame); - virtual void resizeSelection(Selection s, Selection newSize); - virtual void deleteSelection(Selection s); + void moveSelection(Selection s, sv_frame_t newStartFrame) override; + void resizeSelection(Selection s, Selection newSize) override; + void deleteSelection(Selection s) override; - virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); - virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, - bool interactive); + void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; + bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, + bool interactive) override; - virtual const Model *getModel() const { return m_model; } + const Model *getModel() const override { return m_model; } void setModel(SparseOneDimensionalModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + void setProperty(const PropertyName &, int value) override; enum PlotStyle { PlotInstants, @@ -84,24 +84,24 @@ void setPlotStyle(PlotStyle style); PlotStyle getPlotStyle() const { return m_plotStyle; } - virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; + bool isLayerScrollable(const LayerGeometryProvider *v) const override; - virtual bool isLayerEditable() const { return true; } + bool isLayerEditable() const override { return true; } - virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } + int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } - virtual bool needsTextLabelHeight() const { return m_model->hasTextLabels(); } + bool needsTextLabelHeight() const override { return m_model->hasTextLabels(); } - virtual bool getValueExtents(double &, double &, bool &, QString &) const { + bool getValueExtents(double &, double &, bool &, QString &) const override { return false; } - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { if (m_plotStyle == PlotSegmentation) { return ColourHasMeaningfulValue; } else { @@ -109,12 +109,12 @@ } } - virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const { return 0; } + int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const override { return 0; } protected: SparseOneDimensionalModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const; - virtual int getDefaultColourHint(bool dark, bool &impose); + int getDefaultColourHint(bool dark, bool &impose) override; bool clipboardAlignmentDiffers(LayerGeometryProvider *v, const Clipboard &) const; diff -r 4c359c2b220c -r a18e78b9c78b layer/TimeRulerLayer.h --- a/layer/TimeRulerLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/TimeRulerLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -32,41 +32,41 @@ public: TimeRulerLayer(); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; void setModel(Model *); - virtual const Model *getModel() const { return m_model; } + const Model *getModel() const override { return m_model; } enum LabelHeight { LabelTop, LabelMiddle, LabelBottom }; void setLabelHeight(LabelHeight h) { m_labelHeight = h; } LabelHeight getLabelHeight() const { return m_labelHeight; } - virtual bool snapToFeatureFrame(LayerGeometryProvider *, sv_frame_t &, int &, SnapType) const; + bool snapToFeatureFrame(LayerGeometryProvider *, sv_frame_t &, int &, SnapType) const override; - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { return ColourIrrelevant; } - virtual bool getValueExtents(double &, double &, bool &, QString &) const { + bool getValueExtents(double &, double &, bool &, QString &) const override { return false; } - virtual QString getLayerPresentationName() const; + QString getLayerPresentationName() const override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const { return 0; } + int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const override { return 0; } - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; - virtual bool canExistWithoutModel() const { return true; } + bool canExistWithoutModel() const override { return true; } protected: Model *m_model; LabelHeight m_labelHeight; - virtual int getDefaultColourHint(bool dark, bool &impose); + int getDefaultColourHint(bool dark, bool &impose) override; int64_t getMajorTickUSec(LayerGeometryProvider *, bool &quarterTicks) const; int getXForUSec(LayerGeometryProvider *, double usec) const; diff -r 4c359c2b220c -r a18e78b9c78b layer/TimeValueLayer.h --- a/layer/TimeValueLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/TimeValueLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -37,56 +37,56 @@ public: TimeValueLayer(); - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const; - virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const; + int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const override; + void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; - virtual QString getLabelPreceding(sv_frame_t) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; + QString getLabelPreceding(sv_frame_t) const override; - virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, + bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; - virtual bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, + SnapType snap) const override; + bool snapToSimilarFeature(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, - SnapType snap) const; + SnapType snap) const override; - virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); + void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; + void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); + void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); - virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); - virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); + void editStart(LayerGeometryProvider *v, QMouseEvent *) override; + void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; + void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; - virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *); + bool editOpen(LayerGeometryProvider *v, QMouseEvent *) override; - virtual void moveSelection(Selection s, sv_frame_t newStartFrame); - virtual void resizeSelection(Selection s, Selection newSize); - virtual void deleteSelection(Selection s); + void moveSelection(Selection s, sv_frame_t newStartFrame) override; + void resizeSelection(Selection s, Selection newSize) override; + void deleteSelection(Selection s) override; - virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); - virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, - bool interactive); + void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; + bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, + bool interactive) override; - virtual const Model *getModel() const { return m_model; } + const Model *getModel() const override { return m_model; } void setModel(SparseTimeValueModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual QString getPropertyIconName(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + QString getPropertyIconName(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + void setProperty(const PropertyName &, int value) override; void setFillColourMap(int); int getFillColourMap() const { return m_colourMap; } @@ -120,34 +120,34 @@ void setShowDerivative(bool); bool getShowDerivative() const { return m_derivative; } - virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; + bool isLayerScrollable(const LayerGeometryProvider *v) const override; - virtual bool isLayerEditable() const { return true; } + bool isLayerEditable() const override { return true; } - virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } + int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } - virtual bool needsTextLabelHeight() const { + bool needsTextLabelHeight() const override { return m_plotStyle == PlotSegmentation && m_model->hasTextLabels(); } - virtual bool getValueExtents(double &min, double &max, - bool &logarithmic, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &logarithmic, QString &unit) const override; - virtual bool getDisplayExtents(double &min, double &max) const; - virtual bool setDisplayExtents(double min, double max); + bool getDisplayExtents(double &min, double &max) const override; + bool setDisplayExtents(double min, double max) override; - virtual int getVerticalZoomSteps(int &defaultStep) const; - virtual int getCurrentVerticalZoomStep() const; - virtual void setVerticalZoomStep(int); - virtual RangeMapper *getNewVerticalZoomRangeMapper() const; + int getVerticalZoomSteps(int &defaultStep) const override; + int getCurrentVerticalZoomStep() const override; + void setVerticalZoomStep(int) override; + RangeMapper *getNewVerticalZoomRangeMapper() const override; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; /// Override from SingleColourLayer - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { if (m_plotStyle == PlotSegmentation) { return ColourHasMeaningfulValue; } else { @@ -156,7 +156,7 @@ } /// Override from SingleColourLayer - virtual bool hasLightBackground() const { + bool hasLightBackground() const override { if (m_plotStyle == PlotSegmentation) { return true; } else { @@ -165,10 +165,10 @@ } /// VerticalScaleLayer and ColourScaleLayer methods - virtual int getYForValue(LayerGeometryProvider *, double value) const; - virtual double getValueForY(LayerGeometryProvider *, int y) const; - virtual QString getScaleUnits() const; - virtual QColor getColourForValue(LayerGeometryProvider *v, double value) const; + int getYForValue(LayerGeometryProvider *, double value) const override; + double getValueForY(LayerGeometryProvider *, int y) const override; + QString getScaleUnits() const override; + QColor getColourForValue(LayerGeometryProvider *v, double value) const override; protected: void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const; @@ -176,7 +176,7 @@ SparseTimeValueModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const; - virtual int getDefaultColourHint(bool dark, bool &impose); + int getDefaultColourHint(bool dark, bool &impose) override; SparseTimeValueModel *m_model; bool m_editing; diff -r 4c359c2b220c -r a18e78b9c78b layer/WaveformLayer.h --- a/layer/WaveformLayer.h Thu Nov 22 14:55:38 2018 +0000 +++ b/layer/WaveformLayer.h Mon Nov 26 13:52:27 2018 +0000 @@ -36,34 +36,34 @@ WaveformLayer(); ~WaveformLayer(); - virtual const ZoomConstraint *getZoomConstraint() const { + const ZoomConstraint *getZoomConstraint() const override { return m_model ? m_model->getZoomConstraint() : 0; } - virtual const Model *getModel() const { return m_model; } - virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; + const Model *getModel() const override { return m_model; } + void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; - virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; + QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; - virtual ColourSignificance getLayerColourSignificance() const { + ColourSignificance getLayerColourSignificance() const override { return ColourAndBackgroundSignificant; } - virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const; - virtual void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const; + int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const override; + void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const override; void setModel(const RangeSummarisableTimeValueModel *model); - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual QString getPropertyIconName(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual QString getPropertyGroupName(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - virtual RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const; - virtual void setProperty(const PropertyName &, int value); + PropertyList getProperties() const override; + QString getPropertyLabel(const PropertyName &) const override; + QString getPropertyIconName(const PropertyName &) const override; + PropertyType getPropertyType(const PropertyName &) const override; + QString getPropertyGroupName(const PropertyName &) const override; + int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const override; + QString getPropertyValueLabel(const PropertyName &, + int value) const override; + RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override; + void setProperty(const PropertyName &, int value) override; /** * Set the gain multiplier for sample values in this view. @@ -169,29 +169,29 @@ void setAggressiveCacheing(bool); bool getAggressiveCacheing() const { return m_aggressive; } - virtual bool isLayerScrollable(const LayerGeometryProvider *) const; + bool isLayerScrollable(const LayerGeometryProvider *) const override; - virtual int getCompletion(LayerGeometryProvider *) const; + int getCompletion(LayerGeometryProvider *) const override; - virtual bool getValueExtents(double &min, double &max, - bool &log, QString &unit) const; + bool getValueExtents(double &min, double &max, + bool &log, QString &unit) const override; - virtual bool getYScaleValue(const LayerGeometryProvider *v, int y, - double &value, QString &unit) const; + bool getYScaleValue(const LayerGeometryProvider *v, int y, + double &value, QString &unit) const override; - virtual bool getYScaleDifference(const LayerGeometryProvider *v, int y0, int y1, - double &diff, QString &unit) const; + bool getYScaleDifference(const LayerGeometryProvider *v, int y0, int y1, + double &diff, QString &unit) const override; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; - virtual void setProperties(const QXmlAttributes &attributes); + void setProperties(const QXmlAttributes &attributes) override; - virtual int getVerticalZoomSteps(int &defaultStep) const; - virtual int getCurrentVerticalZoomStep() const; - virtual void setVerticalZoomStep(int); + int getVerticalZoomSteps(int &defaultStep) const override; + int getCurrentVerticalZoomStep() const override; + void setVerticalZoomStep(int) override; - virtual bool canExistWithoutModel() const { return true; } + bool canExistWithoutModel() const override { return true; } protected: double dBscale(double sample, int m) const; @@ -231,7 +231,7 @@ float getNormalizeGain(LayerGeometryProvider *v, int channel) const; - virtual void flagBaseColourChanged() { m_cacheValid = false; } + void flagBaseColourChanged() override { m_cacheValid = false; } float m_gain; bool m_autoNormalize; diff -r 4c359c2b220c -r a18e78b9c78b view/AlignmentView.h --- a/view/AlignmentView.h Thu Nov 22 14:55:38 2018 +0000 +++ b/view/AlignmentView.h Mon Nov 26 13:52:27 2018 +0000 @@ -24,21 +24,21 @@ public: AlignmentView(QWidget *parent = 0); - virtual QString getPropertyContainerIconName() const { return "alignment"; } + QString getPropertyContainerIconName() const override { return "alignment"; } void setViewAbove(View *view); void setViewBelow(View *view); public slots: - virtual void globalCentreFrameChanged(sv_frame_t); - virtual void viewCentreFrameChanged(View *, sv_frame_t); + void globalCentreFrameChanged(sv_frame_t) override; + void viewCentreFrameChanged(View *, sv_frame_t) override; virtual void viewAboveZoomLevelChanged(ZoomLevel, bool); virtual void viewBelowZoomLevelChanged(ZoomLevel, bool); - virtual void viewManagerPlaybackFrameChanged(sv_frame_t); + void viewManagerPlaybackFrameChanged(sv_frame_t) override; protected: - virtual void paintEvent(QPaintEvent *e); - virtual bool shouldLabelSelections() const { return false; } + void paintEvent(QPaintEvent *e) override; + bool shouldLabelSelections() const override { return false; } std::vector getKeyFrames(); std::vector getDefaultKeyFrames(); diff -r 4c359c2b220c -r a18e78b9c78b view/Overview.h --- a/view/Overview.h Thu Nov 22 14:55:38 2018 +0000 +++ b/view/Overview.h Mon Nov 26 13:52:27 2018 +0000 @@ -38,28 +38,28 @@ void registerView(View *view); void unregisterView(View *view); - virtual QString getPropertyContainerIconName() const { return "panner"; } + QString getPropertyContainerIconName() const override { return "panner"; } public slots: - virtual void modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame); - virtual void modelReplaced(); + void modelChangedWithin(sv_frame_t startFrame, sv_frame_t endFrame) override; + void modelReplaced() override; - virtual void globalCentreFrameChanged(sv_frame_t); - virtual void viewCentreFrameChanged(View *, sv_frame_t); - virtual void viewZoomLevelChanged(View *, ZoomLevel, bool); - virtual void viewManagerPlaybackFrameChanged(sv_frame_t); + void globalCentreFrameChanged(sv_frame_t) override; + void viewCentreFrameChanged(View *, sv_frame_t) override; + void viewZoomLevelChanged(View *, ZoomLevel, bool) override; + void viewManagerPlaybackFrameChanged(sv_frame_t) override; virtual void setBoxColour(QColor); protected: - virtual void paintEvent(QPaintEvent *e); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); - virtual bool shouldLabelSelections() const { return false; } + void paintEvent(QPaintEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void mouseDoubleClickEvent(QMouseEvent *e) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; + bool shouldLabelSelections() const override { return false; } QColor getFillWithin() const; QColor getFillWithout() const; diff -r 4c359c2b220c -r a18e78b9c78b view/View.h --- a/view/View.h Thu Nov 22 14:55:38 2018 +0000 +++ b/view/View.h Mon Nov 26 13:52:27 2018 +0000 @@ -67,14 +67,14 @@ * Retrieve the id of this object. Views have their own unique * ids, but ViewProxy objects share the id of their View. */ - int getId() const { return m_id; } + int getId() const override { return m_id; } /** * Retrieve the first visible sample frame on the widget. * This is a calculated value based on the centre-frame, widget * width and zoom level. The result may be negative. */ - sv_frame_t getStartFrame() const; + sv_frame_t getStartFrame() const override; /** * Set the widget pan based on the given first visible frame. The @@ -88,7 +88,7 @@ * frame values (start, end) are calculated from this based on the * zoom and other factors. */ - sv_frame_t getCentreFrame() const { return m_centreFrame; } + sv_frame_t getCentreFrame() const override { return m_centreFrame; } /** * Set the centre frame of the visible widget. @@ -100,7 +100,7 @@ * This is a calculated value based on the centre-frame, widget * width and zoom level. */ - sv_frame_t getEndFrame() const; + sv_frame_t getEndFrame() const override; /** * Return the pixel x-coordinate corresponding to a given sample @@ -110,26 +110,26 @@ * visible area, as that could lead to overflow. In that situation * an error will be logged and 0 returned. */ - int getXForFrame(sv_frame_t frame) const; + int getXForFrame(sv_frame_t frame) const override; /** * Return the closest frame to the given pixel x-coordinate. */ - sv_frame_t getFrameForX(int x) const; + sv_frame_t getFrameForX(int x) const override; /** * Return the closest pixel x-coordinate corresponding to a given * view x-coordinate. Default is no scaling, ViewProxy handles * scaling case. */ - int getXForViewX(int viewx) const { return viewx; } + int getXForViewX(int viewx) const override { return viewx; } /** * Return the closest view x-coordinate corresponding to a given * pixel x-coordinate. Default is no scaling, ViewProxy handles * scaling case. */ - int getViewXForX(int x) const { return x; } + int getViewXForX(int x) const override { return x; } /** * Return the pixel y-coordinate corresponding to a given @@ -140,7 +140,7 @@ * Not thread-safe in logarithmic mode. Call only from GUI thread. */ double getYForFrequency(double frequency, double minFreq, double maxFreq, - bool logarithmic) const; + bool logarithmic) const override; /** * Return the closest frequency to the given pixel y-coordinate, @@ -149,13 +149,13 @@ * Not thread-safe in logarithmic mode. Call only from GUI thread. */ double getFrequencyForY(double y, double minFreq, double maxFreq, - bool logarithmic) const; + bool logarithmic) const override; /** * Return the zoom level, i.e. the number of frames per pixel or * pixels per frame */ - ZoomLevel getZoomLevel() const; + ZoomLevel getZoomLevel() const override; /** * Set the zoom level, i.e. the number of frames per pixel or @@ -259,7 +259,7 @@ virtual void setViewManager(ViewManager *m); virtual void setViewManager(ViewManager *m, sv_frame_t initialFrame); - virtual ViewManager *getViewManager() const { return m_manager; } + ViewManager *getViewManager() const override { return m_manager; } virtual void setFollowGlobalPan(bool f); virtual bool getFollowGlobalPan() const { return m_followPan; } @@ -267,17 +267,17 @@ virtual void setFollowGlobalZoom(bool f); virtual bool getFollowGlobalZoom() const { return m_followZoom; } - virtual bool hasLightBackground() const; - virtual QColor getForeground() const; - virtual QColor getBackground() const; + bool hasLightBackground() const override; + QColor getForeground() const override; + QColor getBackground() const override; - virtual void drawMeasurementRect(QPainter &p, const Layer *, - QRect rect, bool focus) const; + void drawMeasurementRect(QPainter &p, const Layer *, + QRect rect, bool focus) const override; - virtual bool shouldShowFeatureLabels() const { + bool shouldShowFeatureLabels() const override { return m_manager && m_manager->shouldShowFeatureLabels(); } - virtual bool shouldIlluminateLocalFeatures(const Layer *, QPoint &) const { + bool shouldIlluminateLocalFeatures(const Layer *, QPoint &) const override { return false; } virtual bool shouldIlluminateLocalSelection(QPoint &, bool &, bool &) const { @@ -349,20 +349,20 @@ virtual bool renderPartToSvgFile(QString filename, sv_frame_t f0, sv_frame_t f1); - virtual int getTextLabelHeight(const Layer *layer, QPainter &) const; + int getTextLabelHeight(const Layer *layer, QPainter &) const override; - virtual bool getValueExtents(QString unit, double &min, double &max, - bool &log) const; + bool getValueExtents(QString unit, double &min, double &max, + bool &log) const override; - virtual void toXml(QTextStream &stream, QString indent = "", - QString extraAttributes = "") const; + void toXml(QTextStream &stream, QString indent = "", + QString extraAttributes = "") const override; // First frame actually in model, to right of scale, if present virtual sv_frame_t getFirstVisibleFrame() const; virtual sv_frame_t getLastVisibleFrame() const; - sv_frame_t getModelsStartFrame() const; - sv_frame_t getModelsEndFrame() const; + sv_frame_t getModelsStartFrame() const override; + sv_frame_t getModelsEndFrame() const override; /** * To be called from a layer, to obtain the extent of the surface @@ -370,16 +370,16 @@ * of the view (if 1x display scaling is in effect) or of a larger * cached pixmap (if greater display scaling is in effect). */ - QRect getPaintRect() const; + QRect getPaintRect() const override; - QSize getPaintSize() const { return getPaintRect().size(); } - int getPaintWidth() const { return getPaintRect().width(); } - int getPaintHeight() const { return getPaintRect().height(); } + QSize getPaintSize() const override { return getPaintRect().size(); } + int getPaintWidth() const override { return getPaintRect().width(); } + int getPaintHeight() const override { return getPaintRect().height(); } - double scaleSize(double size) const; - int scalePixelSize(int size) const; - double scalePenWidth(double width) const; - QPen scalePen(QPen pen) const; + double scaleSize(double size) const override; + int scalePixelSize(int size) const override; + double scalePenWidth(double width) const override; + QPen scalePen(QPen pen) const override; typedef std::set ModelSet; ModelSet getModels(); @@ -390,10 +390,10 @@ sv_frame_t alignToReference(sv_frame_t) const; sv_frame_t getAlignedPlaybackFrame() const; - void updatePaintRect(QRect r) { update(r); } + void updatePaintRect(QRect r) override { update(r); } - View *getView() { return this; } - const View *getView() const { return this; } + View *getView() override { return this; } + const View *getView() const override { return this; } signals: void propertyContainerAdded(PropertyContainer *pc); @@ -446,7 +446,7 @@ int m_id; - virtual void paintEvent(QPaintEvent *e); + void paintEvent(QPaintEvent *e) override; virtual void drawSelections(QPainter &); virtual bool shouldLabelSelections() const { return true; } virtual void drawPlayPointer(QPainter &); @@ -552,29 +552,29 @@ ViewPropertyContainer(View *v); virtual ~ViewPropertyContainer(); - PropertyList getProperties() const { return m_v->getProperties(); } - QString getPropertyLabel(const PropertyName &n) const { + PropertyList getProperties() const override { return m_v->getProperties(); } + QString getPropertyLabel(const PropertyName &n) const override { return m_v->getPropertyLabel(n); } - PropertyType getPropertyType(const PropertyName &n) const { + PropertyType getPropertyType(const PropertyName &n) const override { return m_v->getPropertyType(n); } int getPropertyRangeAndValue(const PropertyName &n, int *min, int *max, - int *deflt) const { + int *deflt) const override { return m_v->getPropertyRangeAndValue(n, min, max, deflt); } - QString getPropertyValueLabel(const PropertyName &n, int value) const { + QString getPropertyValueLabel(const PropertyName &n, int value) const override { return m_v->getPropertyValueLabel(n, value); } - QString getPropertyContainerName() const { + QString getPropertyContainerName() const override { return m_v->getPropertyContainerName(); } - QString getPropertyContainerIconName() const { + QString getPropertyContainerIconName() const override { return m_v->getPropertyContainerIconName(); } public slots: - virtual void setProperty(const PropertyName &n, int value) { + void setProperty(const PropertyName &n, int value) override { m_v->setProperty(n, value); } diff -r 4c359c2b220c -r a18e78b9c78b view/ViewManager.h --- a/view/ViewManager.h Thu Nov 22 14:55:38 2018 +0000 +++ b/view/ViewManager.h Mon Nov 26 13:52:27 2018 +0000 @@ -81,8 +81,8 @@ ViewManager(); virtual ~ViewManager(); - void setAudioPlaySource(AudioPlaySource *source); - void setAudioRecordTarget(AudioRecordTarget *target); + void setAudioPlaySource(AudioPlaySource *source) override; + void setAudioRecordTarget(AudioRecordTarget *target) override; bool isPlaying() const; bool isRecording() const; @@ -96,22 +96,22 @@ Model *getPlaybackModel() const; void setPlaybackModel(Model *); - sv_frame_t alignPlaybackFrameToReference(sv_frame_t) const; - sv_frame_t alignReferenceToPlaybackFrame(sv_frame_t) const; + sv_frame_t alignPlaybackFrameToReference(sv_frame_t) const override; + sv_frame_t alignReferenceToPlaybackFrame(sv_frame_t) const override; bool haveInProgressSelection() const; const Selection &getInProgressSelection(bool &exclusive) const; void setInProgressSelection(const Selection &selection, bool exclusive); void clearInProgressSelection(); - const MultiSelection &getSelection() const; + const MultiSelection &getSelection() const override; - const MultiSelection::SelectionList &getSelections() const; + const MultiSelection::SelectionList &getSelections() const override; void setSelection(const Selection &selection); void addSelection(const Selection &selection); void removeSelection(const Selection &selection); void clearSelections(); - sv_frame_t constrainFrameToSelection(sv_frame_t frame) const; + sv_frame_t constrainFrameToSelection(sv_frame_t frame) const override; /** * Adding a selection normally emits the selectionChangedByUser @@ -126,7 +126,7 @@ * selected area, return the next selection after the given frame. * Return the empty selection if no appropriate selection is found. */ - Selection getContainingSelection(sv_frame_t frame, bool defaultToFollowing) const; + Selection getContainingSelection(sv_frame_t frame, bool defaultToFollowing) const override; Clipboard &getClipboard() { return m_clipboard; } @@ -149,16 +149,16 @@ /// Clear all current view-specific overrides void clearToolModeOverrides(); - bool getPlayLoopMode() const { return m_playLoopMode; } + bool getPlayLoopMode() const override { return m_playLoopMode; } void setPlayLoopMode(bool on); - bool getPlaySelectionMode() const { return m_playSelectionMode; } + bool getPlaySelectionMode() const override { return m_playSelectionMode; } void setPlaySelectionMode(bool on); - bool getPlaySoloMode() const { return m_playSoloMode; } + bool getPlaySoloMode() const override { return m_playSoloMode; } void setPlaySoloMode(bool on); - bool getAlignMode() const { return m_alignMode; } + bool getAlignMode() const override { return m_alignMode; } void setAlignMode(bool on); void setIlluminateLocalFeatures(bool i) { m_illuminateLocalFeatures = i; } @@ -354,9 +354,9 @@ public: SetSelectionCommand(ViewManager *vm, const MultiSelection &ms); virtual ~SetSelectionCommand(); - virtual void execute(); - virtual void unexecute(); - virtual QString getName() const; + void execute() override; + void unexecute() override; + QString getName() const override; protected: ViewManager *m_vm; diff -r 4c359c2b220c -r a18e78b9c78b view/ViewProxy.h --- a/view/ViewProxy.h Thu Nov 22 14:55:38 2018 +0000 +++ b/view/ViewProxy.h Mon Nov 26 13:52:27 2018 +0000 @@ -23,59 +23,59 @@ ViewProxy(View *view, int scaleFactor) : m_view(view), m_scaleFactor(scaleFactor) { } - virtual int getId() const { + int getId() const override { return m_view->getId(); } - virtual sv_frame_t getStartFrame() const { + sv_frame_t getStartFrame() const override { return m_view->getStartFrame(); } - virtual sv_frame_t getCentreFrame() const { + sv_frame_t getCentreFrame() const override { return m_view->getCentreFrame(); } - virtual sv_frame_t getEndFrame() const { + sv_frame_t getEndFrame() const override { return m_view->getEndFrame(); } - virtual int getXForFrame(sv_frame_t frame) const { + int getXForFrame(sv_frame_t frame) const override { //!!! not actually correct, if frame lies between view's pixels return m_scaleFactor * m_view->getXForFrame(frame); } - virtual sv_frame_t getFrameForX(int x) const { + sv_frame_t getFrameForX(int x) const override { sv_frame_t f0 = m_view->getFrameForX(x / m_scaleFactor); if (m_scaleFactor == 1) return f0; sv_frame_t f1 = m_view->getFrameForX((x / m_scaleFactor) + 1); return f0 + ((f1 - f0) * (x % m_scaleFactor)) / m_scaleFactor; } - virtual int getXForViewX(int viewx) const { + int getXForViewX(int viewx) const override { return viewx * m_scaleFactor; } - virtual int getViewXForX(int x) const { + int getViewXForX(int x) const override { return x / m_scaleFactor; } - virtual sv_frame_t getModelsStartFrame() const { + sv_frame_t getModelsStartFrame() const override { return m_view->getModelsStartFrame(); } - virtual sv_frame_t getModelsEndFrame() const { + sv_frame_t getModelsEndFrame() const override { return m_view->getModelsEndFrame(); } - virtual double getYForFrequency(double frequency, + double getYForFrequency(double frequency, double minFreq, double maxFreq, - bool logarithmic) const { + bool logarithmic) const override { return m_scaleFactor * m_view->getYForFrequency(frequency, minFreq, maxFreq, logarithmic); } - virtual double getFrequencyForY(double y, double minFreq, double maxFreq, - bool logarithmic) const { + double getFrequencyForY(double y, double minFreq, double maxFreq, + bool logarithmic) const override { return m_view->getFrequencyForY (y / m_scaleFactor, minFreq, maxFreq, logarithmic); } - virtual int getTextLabelHeight(const Layer *layer, QPainter &paint) const { + int getTextLabelHeight(const Layer *layer, QPainter &paint) const override { return m_scaleFactor * m_view->getTextLabelHeight(layer, paint); } - virtual bool getValueExtents(QString unit, double &min, double &max, - bool &log) const { + bool getValueExtents(QString unit, double &min, double &max, + bool &log) const override { return m_view->getValueExtents(unit, min, max, log); } - virtual ZoomLevel getZoomLevel() const { + ZoomLevel getZoomLevel() const override { ZoomLevel z = m_view->getZoomLevel(); //!!! // cerr << "getZoomLevel: from " << z << " to "; @@ -91,53 +91,53 @@ // cerr << z << endl; return z; } - virtual QRect getPaintRect() const { + QRect getPaintRect() const override { QRect r = m_view->getPaintRect(); return QRect(r.x() * m_scaleFactor, r.y() * m_scaleFactor, r.width() * m_scaleFactor, r.height() * m_scaleFactor); } - virtual QSize getPaintSize() const { + QSize getPaintSize() const override { return getPaintRect().size(); } - virtual int getPaintWidth() const { + int getPaintWidth() const override { return getPaintRect().width(); } - virtual int getPaintHeight() const { + int getPaintHeight() const override { return getPaintRect().height(); } - virtual bool hasLightBackground() const { + bool hasLightBackground() const override { return m_view->hasLightBackground(); } - virtual QColor getForeground() const { + QColor getForeground() const override { return m_view->getForeground(); } - virtual QColor getBackground() const { + QColor getBackground() const override { return m_view->getBackground(); } - virtual ViewManager *getViewManager() const { + ViewManager *getViewManager() const override { return m_view->getViewManager(); } - virtual bool shouldIlluminateLocalFeatures(const Layer *layer, - QPoint &point) const { + bool shouldIlluminateLocalFeatures(const Layer *layer, + QPoint &point) const override { QPoint p; bool should = m_view->shouldIlluminateLocalFeatures(layer, p); point = QPoint(p.x() * m_scaleFactor, p.y() * m_scaleFactor); return should; } - virtual bool shouldShowFeatureLabels() const { + bool shouldShowFeatureLabels() const override { return m_view->shouldShowFeatureLabels(); } - virtual void drawMeasurementRect(QPainter &p, const Layer *layer, - QRect rect, bool focus) const { + void drawMeasurementRect(QPainter &p, const Layer *layer, + QRect rect, bool focus) const override { m_view->drawMeasurementRect(p, layer, rect, focus); } - virtual void updatePaintRect(QRect r) { + void updatePaintRect(QRect r) override { m_view->update(r.x() / m_scaleFactor, r.y() / m_scaleFactor, r.width() / m_scaleFactor, @@ -151,14 +151,14 @@ * pixels. It is also a little more conservative - it never * shrinks the size, it can only increase or leave it unchanged. */ - virtual double scaleSize(double size) const { + double scaleSize(double size) const override { return m_view->scaleSize(size * m_scaleFactor); } /** * Integer version of scaleSize. */ - virtual int scalePixelSize(int size) const { + int scalePixelSize(int size) const override { return m_view->scalePixelSize(size * m_scaleFactor); } @@ -167,7 +167,7 @@ * This is like scaleSize except that it also scales the * zero-width case. */ - virtual double scalePenWidth(double width) const { + double scalePenWidth(double width) const override { if (width <= 0) { // zero-width pen, produce a scaled one-pixel pen width = 1; } @@ -178,12 +178,12 @@ /** * Apply scalePenWidth to a pen. */ - virtual QPen scalePen(QPen pen) const { + QPen scalePen(QPen pen) const override { return QPen(pen.color(), scalePenWidth(pen.width())); } - virtual View *getView() { return m_view; } - virtual const View *getView() const { return m_view; } + View *getView() override { return m_view; } + const View *getView() const override { return m_view; } private: View *m_view; diff -r 4c359c2b220c -r a18e78b9c78b widgets/AudioDial.h --- a/widgets/AudioDial.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/AudioDial.h Mon Nov 26 13:52:27 2018 +0000 @@ -115,15 +115,15 @@ protected: void drawTick(QPainter &paint, double angle, int size, bool internal); - virtual void paintEvent(QPaintEvent *); + void paintEvent(QPaintEvent *) override; // Alternate mouse behavior event handlers. - virtual void mousePressEvent(QMouseEvent *pMouseEvent); - virtual void mouseMoveEvent(QMouseEvent *pMouseEvent); - virtual void mouseReleaseEvent(QMouseEvent *pMouseEvent); - virtual void mouseDoubleClickEvent(QMouseEvent *pMouseEvent); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void mousePressEvent(QMouseEvent *pMouseEvent) override; + void mouseMoveEvent(QMouseEvent *pMouseEvent) override; + void mouseReleaseEvent(QMouseEvent *pMouseEvent) override; + void mouseDoubleClickEvent(QMouseEvent *pMouseEvent) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; protected slots: void updateMappedValue(int value); diff -r 4c359c2b220c -r a18e78b9c78b widgets/ClickableLabel.h --- a/widgets/ClickableLabel.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/ClickableLabel.h Mon Nov 26 13:52:27 2018 +0000 @@ -31,7 +31,7 @@ void clicked(); protected: - virtual void mousePressEvent(QMouseEvent *) { + void mousePressEvent(QMouseEvent *) override { emit clicked(); } }; diff -r 4c359c2b220c -r a18e78b9c78b widgets/Fader.h --- a/widgets/Fader.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/Fader.h Mon Nov 26 13:52:27 2018 +0000 @@ -60,14 +60,14 @@ void mouseLeft(); protected: - virtual void mousePressEvent(QMouseEvent *ev); - virtual void mouseDoubleClickEvent(QMouseEvent *ev); - virtual void mouseMoveEvent(QMouseEvent *ev); - virtual void mouseReleaseEvent(QMouseEvent *ev); - virtual void wheelEvent( QWheelEvent *ev ); - virtual void paintEvent(QPaintEvent *ev); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void mousePressEvent(QMouseEvent *ev) override; + void mouseDoubleClickEvent(QMouseEvent *ev) override; + void mouseMoveEvent(QMouseEvent *ev) override; + void mouseReleaseEvent(QMouseEvent *ev) override; + void wheelEvent( QWheelEvent *ev ) override; + void paintEvent(QPaintEvent *ev) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; int getMaxX() const; diff -r 4c359c2b220c -r a18e78b9c78b widgets/ImageDialog.h --- a/widgets/ImageDialog.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/ImageDialog.h Mon Nov 26 13:52:27 2018 +0000 @@ -54,7 +54,7 @@ void imageEditEdited(); protected: - void resizeEvent(QResizeEvent *); + void resizeEvent(QResizeEvent *) override; QLineEdit *m_imageEdit; QLineEdit *m_labelEdit; diff -r 4c359c2b220c -r a18e78b9c78b widgets/InteractiveFileFinder.h --- a/widgets/InteractiveFileFinder.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/InteractiveFileFinder.h Mon Nov 26 13:52:27 2018 +0000 @@ -38,11 +38,11 @@ return m_sessionExtension; } - QString getOpenFileName(FileType type, QString fallbackLocation = ""); - QString getSaveFileName(FileType type, QString fallbackLocation = ""); - void registerLastOpenedFilePath(FileType type, QString path); + QString getOpenFileName(FileType type, QString fallbackLocation = "") override; + QString getSaveFileName(FileType type, QString fallbackLocation = "") override; + void registerLastOpenedFilePath(FileType type, QString path) override; - QString find(FileType type, QString location, QString lastKnownLocation = ""); + QString find(FileType type, QString location, QString lastKnownLocation = "") override; static void setParentWidget(QWidget *); diff -r 4c359c2b220c -r a18e78b9c78b widgets/LEDButton.h --- a/widgets/LEDButton.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/LEDButton.h Mon Nov 26 13:52:27 2018 +0000 @@ -49,8 +49,8 @@ QColor color() const; int darkFactor() const; - virtual QSize sizeHint() const; - virtual QSize minimumSizeHint() const; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; signals: void stateChanged(bool); @@ -69,10 +69,10 @@ void setDarkFactor(int darkfactor); protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - void enterEvent(QEvent *); - void leaveEvent(QEvent *); + void paintEvent(QPaintEvent *) override; + void mousePressEvent(QMouseEvent *) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; bool led_state; QColor led_color; diff -r 4c359c2b220c -r a18e78b9c78b widgets/LayerTree.h --- a/widgets/LayerTree.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/LayerTree.h Mon Nov 26 13:52:27 2018 +0000 @@ -36,22 +36,22 @@ ModelMetadataModel(PaneStack *stack, bool waveModelsOnly, QObject *parent = 0); virtual ~ModelMetadataModel(); - QVariant data(const QModelIndex &index, int role) const; + QVariant data(const QModelIndex &index, int role) const override; - bool setData(const QModelIndex &index, const QVariant &value, int role); + bool setData(const QModelIndex &index, const QVariant &value, int role) override; - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; + int role = Qt::DisplayRole) const override; QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; + const QModelIndex &parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex &index) const; + QModelIndex parent(const QModelIndex &index) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; protected slots: void paneAdded(); @@ -84,22 +84,22 @@ LayerTreeModel(PaneStack *stack, QObject *parent = 0); virtual ~LayerTreeModel(); - QVariant data(const QModelIndex &index, int role) const; + QVariant data(const QModelIndex &index, int role) const override; - bool setData(const QModelIndex &index, const QVariant &value, int role); + bool setData(const QModelIndex &index, const QVariant &value, int role) override; - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; + int role = Qt::DisplayRole) const override; QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; + const QModelIndex &parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex &index) const; + QModelIndex parent(const QModelIndex &index) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; protected slots: void paneAdded(); diff -r 4c359c2b220c -r a18e78b9c78b widgets/LevelPanToolButton.h --- a/widgets/LevelPanToolButton.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/LevelPanToolButton.h Mon Nov 26 13:52:27 2018 +0000 @@ -67,11 +67,11 @@ void selfClicked(); protected: - virtual void paintEvent(QPaintEvent *); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void wheelEvent(QWheelEvent *e); + void paintEvent(QPaintEvent *) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; + void mousePressEvent(QMouseEvent *) override; + void wheelEvent(QWheelEvent *e) override; LevelPanWidget *m_lpw; int m_pixels; diff -r 4c359c2b220c -r a18e78b9c78b widgets/LevelPanWidget.h --- a/widgets/LevelPanWidget.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/LevelPanWidget.h Mon Nov 26 13:52:27 2018 +0000 @@ -47,7 +47,7 @@ /// Draw a suitably sized copy of the widget's contents to the given device void renderTo(QPaintDevice *, QRectF, bool asIfEditable) const; - QSize sizeHint() const; + QSize sizeHint() const override; public slots: /// Set level. The basic level range is [0,1] but the scale may go @@ -70,7 +70,7 @@ void setToDefault(); // public so it can be called from LevelPanToolButton (ew) - virtual void wheelEvent(QWheelEvent *ev); + void wheelEvent(QWheelEvent *ev) override; signals: void levelChanged(float); // range [0,1] @@ -80,12 +80,12 @@ void mouseLeft(); protected: - virtual void mousePressEvent(QMouseEvent *ev); - virtual void mouseMoveEvent(QMouseEvent *ev); - virtual void mouseReleaseEvent(QMouseEvent *ev); - virtual void paintEvent(QPaintEvent *ev); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void mousePressEvent(QMouseEvent *ev) override; + void mouseMoveEvent(QMouseEvent *ev) override; + void mouseReleaseEvent(QMouseEvent *ev) override; + void paintEvent(QPaintEvent *ev) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; void emitLevelChanged(); void emitPanChanged(); diff -r 4c359c2b220c -r a18e78b9c78b widgets/MIDIFileImportDialog.h --- a/widgets/MIDIFileImportDialog.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/MIDIFileImportDialog.h Mon Nov 26 13:52:27 2018 +0000 @@ -27,11 +27,11 @@ public: MIDIFileImportDialog(QWidget *parent = 0); - virtual TrackPreference getTrackImportPreference + TrackPreference getTrackImportPreference (QStringList trackNames, bool haveSomePercussion, - QString &singleTrack) const; + QString &singleTrack) const override; - virtual void showError(QString error); + void showError(QString error) override; protected: QWidget *m_parent; diff -r 4c359c2b220c -r a18e78b9c78b widgets/NotifyingCheckBox.h --- a/widgets/NotifyingCheckBox.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/NotifyingCheckBox.h Mon Nov 26 13:52:27 2018 +0000 @@ -38,8 +38,8 @@ void mouseLeft(); protected: - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; }; #endif diff -r 4c359c2b220c -r a18e78b9c78b widgets/NotifyingComboBox.h --- a/widgets/NotifyingComboBox.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/NotifyingComboBox.h Mon Nov 26 13:52:27 2018 +0000 @@ -38,8 +38,8 @@ void mouseLeft(); protected: - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; }; #endif diff -r 4c359c2b220c -r a18e78b9c78b widgets/NotifyingPushButton.h --- a/widgets/NotifyingPushButton.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/NotifyingPushButton.h Mon Nov 26 13:52:27 2018 +0000 @@ -39,8 +39,8 @@ void mouseLeft(); protected: - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; }; #endif diff -r 4c359c2b220c -r a18e78b9c78b widgets/NotifyingTabBar.h --- a/widgets/NotifyingTabBar.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/NotifyingTabBar.h Mon Nov 26 13:52:27 2018 +0000 @@ -32,9 +32,9 @@ void activeTabClicked(); protected: - virtual void mousePressEvent(QMouseEvent *); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void mousePressEvent(QMouseEvent *) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; }; #endif diff -r 4c359c2b220c -r a18e78b9c78b widgets/NotifyingToolButton.h --- a/widgets/NotifyingToolButton.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/NotifyingToolButton.h Mon Nov 26 13:52:27 2018 +0000 @@ -39,8 +39,8 @@ void mouseLeft(); protected: - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; }; #endif diff -r 4c359c2b220c -r a18e78b9c78b widgets/Panner.h --- a/widgets/Panner.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/Panner.h Mon Nov 26 13:52:27 2018 +0000 @@ -43,7 +43,7 @@ void getRectExtents(float &x0, float &y0, float &width, float &height); - virtual QSize sizeHint() const; + QSize sizeHint() const override; signals: /** @@ -120,14 +120,14 @@ void resetToDefault(); protected: - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - virtual void wheelEvent(QWheelEvent *e); - virtual void paintEvent(QPaintEvent *e); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void mousePressEvent(QMouseEvent *e) override; + void mouseDoubleClickEvent(QMouseEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + void wheelEvent(QWheelEvent *e) override; + void paintEvent(QPaintEvent *e) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; void normalise(); void emitAndUpdate(); diff -r 4c359c2b220c -r a18e78b9c78b widgets/PluginParameterDialog.h --- a/widgets/PluginParameterDialog.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/PluginParameterDialog.h Mon Nov 26 13:52:27 2018 +0000 @@ -74,7 +74,7 @@ void getProcessingParameters(int &stepSize, int &blockSize, WindowType &windowType) const; - int exec(); + int exec() override; signals: void pluginConfigurationChanged(QString); diff -r 4c359c2b220c -r a18e78b9c78b widgets/ProgressDialog.h --- a/widgets/ProgressDialog.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/ProgressDialog.h Mon Nov 26 13:52:27 2018 +0000 @@ -32,18 +32,18 @@ Qt::WindowModality modality = Qt::NonModal); virtual ~ProgressDialog(); - virtual bool isDefinite() const; - virtual void setDefinite(bool definite); + bool isDefinite() const override; + void setDefinite(bool definite) override; - virtual bool wasCancelled() const; + bool wasCancelled() const override; signals: void showing(); void cancelled(); public slots: - virtual void setMessage(QString text); - virtual void setProgress(int percentage); + void setMessage(QString text) override; + void setProgress(int percentage) override; protected slots: virtual void showTimerElapsed(); diff -r 4c359c2b220c -r a18e78b9c78b widgets/SelectableLabel.h --- a/widgets/SelectableLabel.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/SelectableLabel.h Mon Nov 26 13:52:27 2018 +0000 @@ -40,11 +40,11 @@ void toggle(); protected: - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void mousePressEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + void mouseDoubleClickEvent(QMouseEvent *e) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; void setupStyle(); QString m_selectedText; QString m_unselectedText; diff -r 4c359c2b220c -r a18e78b9c78b widgets/Thumbwheel.h --- a/widgets/Thumbwheel.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/Thumbwheel.h Mon Nov 26 13:52:27 2018 +0000 @@ -47,7 +47,7 @@ void setShowToolTip(bool show); - QSize sizeHint() const; + QSize sizeHint() const override; signals: void valueChanged(int); @@ -71,14 +71,14 @@ void updateMappedValue(int value); protected: - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - virtual void wheelEvent(QWheelEvent *e); - virtual void paintEvent(QPaintEvent *e); - virtual void enterEvent(QEvent *); - virtual void leaveEvent(QEvent *); + void mousePressEvent(QMouseEvent *e) override; + void mouseDoubleClickEvent(QMouseEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + void wheelEvent(QWheelEvent *e) override; + void paintEvent(QPaintEvent *e) override; + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; int m_min; int m_max; diff -r 4c359c2b220c -r a18e78b9c78b widgets/TipDialog.h --- a/widgets/TipDialog.h Thu Nov 22 14:55:38 2018 +0000 +++ b/widgets/TipDialog.h Mon Nov 26 13:52:27 2018 +0000 @@ -59,19 +59,19 @@ void parse(QXmlInputSource &source); - virtual bool startElement(const QString &namespaceURI, + bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, - const QXmlAttributes& atts); + const QXmlAttributes& atts) override; - virtual bool characters(const QString &); + bool characters(const QString &) override; - virtual bool endElement(const QString &namespaceURI, + bool endElement(const QString &namespaceURI, const QString &localName, - const QString &qName); + const QString &qName) override; - bool error(const QXmlParseException &exception); - bool fatalError(const QXmlParseException &exception); + bool error(const QXmlParseException &exception) override; + bool fatalError(const QXmlParseException &exception) override; protected: TipDialog *m_dialog;