Mercurial > hg > svcore
comparison data/model/SparseOneDimensionalModel.h @ 1804:343ef2a866a4
Implement missing TabularModel editing methods. Also made these pure in TabularModel, since almost all subclasses want them and (clearly) forgetting to implement them is a problem!
author | Chris Cannam |
---|---|
date | Mon, 14 Oct 2019 14:17:37 +0100 |
parents | 13bd41bd8a17 |
children | c546429d4c2f |
comparison
equal
deleted
inserted
replaced
1803:6eb3a76c74f7 | 1804:343ef2a866a4 |
---|---|
241 command->remove(e0); | 241 command->remove(e0); |
242 command->add(e1); | 242 command->add(e1); |
243 return command->finish(); | 243 return command->finish(); |
244 } | 244 } |
245 | 245 |
246 bool isEditable() const override { return true; } | |
247 | |
248 Command *getInsertRowCommand(int row) override { | |
249 if (row < 0 || row >= m_events.count()) return nullptr; | |
250 auto command = new ChangeEventsCommand(getId().untyped, | |
251 tr("Add Point")); | |
252 Event e = m_events.getEventByIndex(row); | |
253 command->add(e); | |
254 return command->finish(); | |
255 } | |
256 | |
257 Command *getRemoveRowCommand(int row) override { | |
258 if (row < 0 || row >= m_events.count()) return nullptr; | |
259 auto command = new ChangeEventsCommand(getId().untyped, | |
260 tr("Delete Point")); | |
261 Event e = m_events.getEventByIndex(row); | |
262 command->remove(e); | |
263 return command->finish(); | |
264 } | |
265 | |
246 /** | 266 /** |
247 * NoteExportable methods. | 267 * NoteExportable methods. |
248 */ | 268 */ |
249 | 269 |
250 NoteList getNotes() const override { | 270 NoteList getNotes() const override { |