comparison layer/TimeInstantLayer.h @ 1406:a18e78b9c78b fix-static-analysis

Use override throughout
author Chris Cannam
date Mon, 26 Nov 2018 13:52:27 +0000
parents a34a2a25907c
children 05d614f6e46d
comparison
equal deleted inserted replaced
1405:4c359c2b220c 1406:a18e78b9c78b
31 31
32 public: 32 public:
33 TimeInstantLayer(); 33 TimeInstantLayer();
34 virtual ~TimeInstantLayer(); 34 virtual ~TimeInstantLayer();
35 35
36 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; 36 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override;
37 37
38 virtual QString getLabelPreceding(sv_frame_t) const; 38 QString getLabelPreceding(sv_frame_t) const override;
39 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; 39 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override;
40 40
41 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, 41 bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
42 int &resolution, 42 int &resolution,
43 SnapType snap) const; 43 SnapType snap) const override;
44 44
45 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); 45 void drawStart(LayerGeometryProvider *v, QMouseEvent *) override;
46 virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); 46 void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override;
47 virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); 47 void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override;
48 48
49 virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); 49 void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override;
50 virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); 50 void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override;
51 virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); 51 void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override;
52 52
53 virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); 53 void editStart(LayerGeometryProvider *v, QMouseEvent *) override;
54 virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); 54 void editDrag(LayerGeometryProvider *v, QMouseEvent *) override;
55 virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); 55 void editEnd(LayerGeometryProvider *v, QMouseEvent *) override;
56 56
57 virtual bool editOpen(LayerGeometryProvider *, QMouseEvent *); 57 bool editOpen(LayerGeometryProvider *, QMouseEvent *) override;
58 58
59 virtual void moveSelection(Selection s, sv_frame_t newStartFrame); 59 void moveSelection(Selection s, sv_frame_t newStartFrame) override;
60 virtual void resizeSelection(Selection s, Selection newSize); 60 void resizeSelection(Selection s, Selection newSize) override;
61 virtual void deleteSelection(Selection s); 61 void deleteSelection(Selection s) override;
62 62
63 virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); 63 void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override;
64 virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, 64 bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset,
65 bool interactive); 65 bool interactive) override;
66 66
67 virtual const Model *getModel() const { return m_model; } 67 const Model *getModel() const override { return m_model; }
68 void setModel(SparseOneDimensionalModel *model); 68 void setModel(SparseOneDimensionalModel *model);
69 69
70 virtual PropertyList getProperties() const; 70 PropertyList getProperties() const override;
71 virtual QString getPropertyLabel(const PropertyName &) const; 71 QString getPropertyLabel(const PropertyName &) const override;
72 virtual PropertyType getPropertyType(const PropertyName &) const; 72 PropertyType getPropertyType(const PropertyName &) const override;
73 virtual int getPropertyRangeAndValue(const PropertyName &, 73 int getPropertyRangeAndValue(const PropertyName &,
74 int *min, int *max, int *deflt) const; 74 int *min, int *max, int *deflt) const override;
75 virtual QString getPropertyValueLabel(const PropertyName &, 75 QString getPropertyValueLabel(const PropertyName &,
76 int value) const; 76 int value) const override;
77 virtual void setProperty(const PropertyName &, int value); 77 void setProperty(const PropertyName &, int value) override;
78 78
79 enum PlotStyle { 79 enum PlotStyle {
80 PlotInstants, 80 PlotInstants,
81 PlotSegmentation 81 PlotSegmentation
82 }; 82 };
83 83
84 void setPlotStyle(PlotStyle style); 84 void setPlotStyle(PlotStyle style);
85 PlotStyle getPlotStyle() const { return m_plotStyle; } 85 PlotStyle getPlotStyle() const { return m_plotStyle; }
86 86
87 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; 87 bool isLayerScrollable(const LayerGeometryProvider *v) const override;
88 88
89 virtual bool isLayerEditable() const { return true; } 89 bool isLayerEditable() const override { return true; }
90 90
91 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } 91 int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); }
92 92
93 virtual bool needsTextLabelHeight() const { return m_model->hasTextLabels(); } 93 bool needsTextLabelHeight() const override { return m_model->hasTextLabels(); }
94 94
95 virtual bool getValueExtents(double &, double &, bool &, QString &) const { 95 bool getValueExtents(double &, double &, bool &, QString &) const override {
96 return false; 96 return false;
97 } 97 }
98 98
99 virtual void toXml(QTextStream &stream, QString indent = "", 99 void toXml(QTextStream &stream, QString indent = "",
100 QString extraAttributes = "") const; 100 QString extraAttributes = "") const override;
101 101
102 void setProperties(const QXmlAttributes &attributes); 102 void setProperties(const QXmlAttributes &attributes) override;
103 103
104 virtual ColourSignificance getLayerColourSignificance() const { 104 ColourSignificance getLayerColourSignificance() const override {
105 if (m_plotStyle == PlotSegmentation) { 105 if (m_plotStyle == PlotSegmentation) {
106 return ColourHasMeaningfulValue; 106 return ColourHasMeaningfulValue;
107 } else { 107 } else {
108 return ColourDistinguishes; 108 return ColourDistinguishes;
109 } 109 }
110 } 110 }
111 111
112 virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const { return 0; } 112 int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const override { return 0; }
113 113
114 protected: 114 protected:
115 SparseOneDimensionalModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const; 115 SparseOneDimensionalModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const;
116 116
117 virtual int getDefaultColourHint(bool dark, bool &impose); 117 int getDefaultColourHint(bool dark, bool &impose) override;
118 118
119 bool clipboardAlignmentDiffers(LayerGeometryProvider *v, const Clipboard &) const; 119 bool clipboardAlignmentDiffers(LayerGeometryProvider *v, const Clipboard &) const;
120 120
121 SparseOneDimensionalModel *m_model; 121 SparseOneDimensionalModel *m_model;
122 bool m_editing; 122 bool m_editing;