Mercurial > hg > svcore
comparison data/model/IntervalModel.h @ 438:32c399d06374
* minor tidy
author | Chris Cannam |
---|---|
date | Thu, 07 Aug 2008 16:06:59 +0000 |
parents | 7226ebac8bd3 |
children | 6441b31b37ac |
comparison
equal
deleted
inserted
replaced
437:7226ebac8bd3 | 438:32c399d06374 |
---|---|
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) | 85 virtual Command *getSetDataCommand(int row, int column, const QVariant &value, int role) |
86 { | 86 { |
87 typedef IntervalModel<PointType> I; | |
88 | |
87 if (column < 2) { | 89 if (column < 2) { |
88 return SparseValueModel<PointType>::getSetDataCommand | 90 return SparseValueModel<PointType>::getSetDataCommand |
89 (row, column, value, role); | 91 (row, column, value, role); |
90 } | 92 } |
91 | 93 |
92 if (role != Qt::EditRole) return false; | 94 if (role != Qt::EditRole) return false; |
93 // gah. This is such garbage. Thank you, C++! I love you too | 95 typename I::PointList::const_iterator i |
94 typename SparseModel<PointType>::PointList::const_iterator i | 96 = I::getPointListIteratorForRow(row); |
95 = SparseModel<PointType>::getPointListIteratorForRow(row); | 97 if (i == I::m_points.end()) return false; |
96 if (i == SparseModel<PointType>::m_points.end()) return false; | 98 typename I::EditCommand *command = new typename I::EditCommand |
97 typename IntervalModel<PointType>::EditCommand *command | 99 (this, I::tr("Edit Data")); |
98 = new typename IntervalModel<PointType>::EditCommand | |
99 (this, IntervalModel<PointType>::tr("Edit Data")); | |
100 | 100 |
101 PointType point(*i); | 101 PointType point(*i); |
102 command->deletePoint(point); | 102 command->deletePoint(point); |
103 | 103 |
104 switch (column) { | 104 switch (column) { |