comparison data/model/ModelDataTableModel.cpp @ 437:7226ebac8bd3

* Add IntervalModel as base class for NoteModel (and other, further models, hopefully)
author Chris Cannam
date Thu, 07 Aug 2008 15:59:20 +0000
parents 304fd0223fa6
children ba7aaacb7211
comparison
equal deleted inserted replaced
436:cff476cfce77 437:7226ebac8bd3
158 } 158 }
159 159
160 void 160 void
161 ModelDataTableModel::sort(int column, Qt::SortOrder sortOrder) 161 ModelDataTableModel::sort(int column, Qt::SortOrder sortOrder)
162 { 162 {
163 std::cerr << "ModelDataTableModel::sort(" << column << ", " << sortOrder 163 // std::cerr << "ModelDataTableModel::sort(" << column << ", " << sortOrder
164 << ")" << std::endl; 164 // << ")" << std::endl;
165 int prevCurrent = getCurrentRow(); 165 int prevCurrent = getCurrentRow();
166 if (m_sortColumn != column) { 166 if (m_sortColumn != column) {
167 clearSort(); 167 clearSort();
168 } 168 }
169 m_sortColumn = column; 169 m_sortColumn = column;
170 m_sortOrdering = sortOrder; 170 m_sortOrdering = sortOrder;
171 int current = getCurrentRow(); 171 int current = getCurrentRow();
172 if (current != prevCurrent) { 172 if (current != prevCurrent) {
173 std::cerr << "Current row changed from " << prevCurrent << " to " << current << " for underlying row " << m_currentRow << std::endl; 173 // std::cerr << "Current row changed from " << prevCurrent << " to " << current << " for underlying row " << m_currentRow << std::endl;
174 emit currentChanged(createIndex(current, 0, 0)); 174 emit currentChanged(createIndex(current, 0, 0));
175 } 175 }
176 emit layoutChanged(); 176 emit layoutChanged();
177 } 177 }
178 178