comparison data/model/RegionModel.h @ 1580:c01cbe41aeb5 fix-static-analysis

Use override throughout
author Chris Cannam
date Mon, 26 Nov 2018 13:48:45 +0000
parents 48e9f538e6e9
children ad5f892c0c4d
comparison
equal deleted inserted replaced
1579:232d6ddf257d 1580:c01cbe41aeb5
120 float getValueQuantization() const { return m_valueQuantization; } 120 float getValueQuantization() const { return m_valueQuantization; }
121 void setValueQuantization(float q) { m_valueQuantization = q; } 121 void setValueQuantization(float q) { m_valueQuantization = q; }
122 122
123 bool haveDistinctValues() const { return m_haveDistinctValues; } 123 bool haveDistinctValues() const { return m_haveDistinctValues; }
124 124
125 QString getTypeName() const { return tr("Region"); } 125 QString getTypeName() const override { return tr("Region"); }
126 126
127 virtual void toXml(QTextStream &out, 127 void toXml(QTextStream &out,
128 QString indent = "", 128 QString indent = "",
129 QString extraAttributes = "") const 129 QString extraAttributes = "") const override
130 { 130 {
131 std::cerr << "RegionModel::toXml: extraAttributes = \"" 131 std::cerr << "RegionModel::toXml: extraAttributes = \""
132 << extraAttributes.toStdString() << std::endl; 132 << extraAttributes.toStdString() << std::endl;
133 133
134 IntervalModel<RegionRec>::toXml 134 IntervalModel<RegionRec>::toXml
140 140
141 /** 141 /**
142 * TabularModel methods. 142 * TabularModel methods.
143 */ 143 */
144 144
145 virtual int getColumnCount() const 145 int getColumnCount() const override
146 { 146 {
147 return 5; 147 return 5;
148 } 148 }
149 149
150 virtual QString getHeading(int column) const 150 QString getHeading(int column) const override
151 { 151 {
152 switch (column) { 152 switch (column) {
153 case 0: return tr("Time"); 153 case 0: return tr("Time");
154 case 1: return tr("Frame"); 154 case 1: return tr("Frame");
155 case 2: return tr("Value"); 155 case 2: return tr("Value");
157 case 4: return tr("Label"); 157 case 4: return tr("Label");
158 default: return tr("Unknown"); 158 default: return tr("Unknown");
159 } 159 }
160 } 160 }
161 161
162 virtual QVariant getData(int row, int column, int role) const 162 QVariant getData(int row, int column, int role) const override
163 { 163 {
164 if (column < 4) { 164 if (column < 4) {
165 return IntervalModel<RegionRec>::getData(row, column, role); 165 return IntervalModel<RegionRec>::getData(row, column, role);
166 } 166 }
167 167
172 case 4: return i->label; 172 case 4: return i->label;
173 default: return QVariant(); 173 default: return QVariant();
174 } 174 }
175 } 175 }
176 176
177 virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) 177 Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override
178 { 178 {
179 if (column < 4) { 179 if (column < 4) {
180 return IntervalModel<RegionRec>::getSetDataCommand 180 return IntervalModel<RegionRec>::getSetDataCommand
181 (row, column, value, role); 181 (row, column, value, role);
182 } 182 }
195 195
196 command->addPoint(point); 196 command->addPoint(point);
197 return command->finish(); 197 return command->finish();
198 } 198 }
199 199
200 virtual SortType getSortType(int column) const 200 SortType getSortType(int column) const override
201 { 201 {
202 if (column == 4) return SortAlphabetical; 202 if (column == 4) return SortAlphabetical;
203 return SortNumeric; 203 return SortNumeric;
204 } 204 }
205 205
206 virtual void addPoint(const Point &point) 206 void addPoint(const Point &point) override
207 { 207 {
208 if (point.value != 0.f) m_haveDistinctValues = true; 208 if (point.value != 0.f) m_haveDistinctValues = true;
209 IntervalModel<RegionRec>::addPoint(point); 209 IntervalModel<RegionRec>::addPoint(point);
210 } 210 }
211 211