Mercurial > hg > svcore
comparison data/model/SparseTimeValueModel.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 |
---|---|
106 virtual ~SparseTimeValueModel() | 106 virtual ~SparseTimeValueModel() |
107 { | 107 { |
108 PlayParameterRepository::getInstance()->removePlayable(this); | 108 PlayParameterRepository::getInstance()->removePlayable(this); |
109 } | 109 } |
110 | 110 |
111 QString getTypeName() const { return tr("Sparse Time-Value"); } | 111 QString getTypeName() const override { return tr("Sparse Time-Value"); } |
112 | 112 |
113 virtual bool canPlay() const { return true; } | 113 bool canPlay() const override { return true; } |
114 virtual bool getDefaultPlayAudible() const { return false; } // user must unmute | 114 bool getDefaultPlayAudible() const override { return false; } // user must unmute |
115 | 115 |
116 /** | 116 /** |
117 * TabularModel methods. | 117 * TabularModel methods. |
118 */ | 118 */ |
119 | 119 |
120 virtual int getColumnCount() const | 120 int getColumnCount() const override |
121 { | 121 { |
122 return 4; | 122 return 4; |
123 } | 123 } |
124 | 124 |
125 virtual QString getHeading(int column) const | 125 QString getHeading(int column) const override |
126 { | 126 { |
127 switch (column) { | 127 switch (column) { |
128 case 0: return tr("Time"); | 128 case 0: return tr("Time"); |
129 case 1: return tr("Frame"); | 129 case 1: return tr("Frame"); |
130 case 2: return tr("Value"); | 130 case 2: return tr("Value"); |
131 case 3: return tr("Label"); | 131 case 3: return tr("Label"); |
132 default: return tr("Unknown"); | 132 default: return tr("Unknown"); |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 virtual QVariant getData(int row, int column, int role) const | 136 QVariant getData(int row, int column, int role) const override |
137 { | 137 { |
138 if (column < 2) { | 138 if (column < 2) { |
139 return SparseValueModel<TimeValuePoint>::getData | 139 return SparseValueModel<TimeValuePoint>::getData |
140 (row, column, role); | 140 (row, column, role); |
141 } | 141 } |
150 case 3: return i->label; | 150 case 3: return i->label; |
151 default: return QVariant(); | 151 default: return QVariant(); |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) | 155 Command *getSetDataCommand(int row, int column, const QVariant &value, int role) override |
156 { | 156 { |
157 if (column < 2) { | 157 if (column < 2) { |
158 return SparseValueModel<TimeValuePoint>::getSetDataCommand | 158 return SparseValueModel<TimeValuePoint>::getSetDataCommand |
159 (row, column, value, role); | 159 (row, column, value, role); |
160 } | 160 } |
174 | 174 |
175 command->addPoint(point); | 175 command->addPoint(point); |
176 return command->finish(); | 176 return command->finish(); |
177 } | 177 } |
178 | 178 |
179 virtual bool isColumnTimeValue(int column) const | 179 bool isColumnTimeValue(int column) const override |
180 { | 180 { |
181 return (column < 2); | 181 return (column < 2); |
182 } | 182 } |
183 | 183 |
184 virtual SortType getSortType(int column) const | 184 SortType getSortType(int column) const override |
185 { | 185 { |
186 if (column == 3) return SortAlphabetical; | 186 if (column == 3) return SortAlphabetical; |
187 return SortNumeric; | 187 return SortNumeric; |
188 } | 188 } |
189 }; | 189 }; |