comparison data/model/SparseModel.h @ 416:a00902d5f0ab

* basics of data editing in data table view
author Chris Cannam
date Mon, 09 Jun 2008 16:01:50 +0000
parents 88ad01799040
children 50a956688baa
comparison
equal deleted inserted replaced
415:e37e44681720 416:a00902d5f0ab
216 virtual void addCommand(Command *command) { addCommand(command, true); } 216 virtual void addCommand(Command *command) { addCommand(command, true); }
217 217
218 /** 218 /**
219 * If any points have been added or deleted, return this 219 * If any points have been added or deleted, return this
220 * command (so the caller can add it to the command history). 220 * command (so the caller can add it to the command history).
221 * Otherwise delete the command. 221 * Otherwise delete the command and return NULL.
222 */ 222 */
223 virtual Command *finish(); 223 virtual EditCommand *finish();
224 224
225 protected: 225 protected:
226 virtual void addCommand(Command *command, bool executeFirst); 226 virtual void addCommand(Command *command, bool executeFirst);
227 227
228 SparseModel<PointType> *m_model; 228 SparseModel<PointType> *m_model;
603 { 603 {
604 addCommand(new DeletePointCommand(m_model, point), true); 604 addCommand(new DeletePointCommand(m_model, point), true);
605 } 605 }
606 606
607 template <typename PointType> 607 template <typename PointType>
608 Command * 608 typename SparseModel<PointType>::EditCommand *
609 SparseModel<PointType>::EditCommand::finish() 609 SparseModel<PointType>::EditCommand::finish()
610 { 610 {
611 if (!m_commands.empty()) { 611 if (!m_commands.empty()) {
612 return this; 612 return this;
613 } else { 613 } else {