comparison data/model/SparseTimeValueModel.h @ 421:397fe91dc8e0

* Fix for data modification in data edit view... now why isn't the command appearing on the undo menu?
author Chris Cannam
date Wed, 11 Jun 2008 17:00:04 +0000
parents 50a956688baa
children 4caa28a0a8a2
comparison
equal deleted inserted replaced
420:50a956688baa 421:397fe91dc8e0
136 case 3: return i->label; 136 case 3: return i->label;
137 default: return QVariant(); 137 default: return QVariant();
138 } 138 }
139 } 139 }
140 140
141 virtual Command *setData(int row, int column, QVariant value, int role) 141 virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) const
142 { 142 {
143 std::cerr << "SparseTimeValueModel::setData: row = " << row << ", column = " << column << ", role = " << role << std::endl;
144
143 if (role != Qt::EditRole) return false; 145 if (role != Qt::EditRole) return false;
144 PointListIterator i = getPointListIteratorForRow(row); 146 PointListIterator i = getPointListIteratorForRow(row);
145 if (i == m_points.end()) return false; 147 if (i == m_points.end()) {
148 std::cerr << "Failed to find point iterator for row " << row << std::endl;
149 return false;
150 }
146 EditCommand *command = new EditCommand(this, tr("Edit Data")); 151 EditCommand *command = new EditCommand(this, tr("Edit Data"));
147 152
148 Point point(*i); 153 Point point(*i);
149 command->deletePoint(point); 154 command->deletePoint(point);
150 155