Mercurial > hg > svcore
comparison data/model/ModelDataTableModel.cpp @ 419:64e7bbb255d3
* A bit more work on the data editor
author | Chris Cannam |
---|---|
date | Wed, 11 Jun 2008 12:54:18 +0000 |
parents | 12b7bf0c3915 |
children | 50a956688baa |
comparison
equal
deleted
inserted
replaced
418:d35d4e79c95b | 419:64e7bbb255d3 |
---|---|
294 std::lower_bound(m_rows.begin(), m_rows.end(), frame); | 294 std::lower_bound(m_rows.begin(), m_rows.end(), frame); |
295 size_t dist = std::distance(m_rows.begin(), i); | 295 size_t dist = std::distance(m_rows.begin(), i); |
296 return createIndex(dist, 0, 0); | 296 return createIndex(dist, 0, 0); |
297 } | 297 } |
298 | 298 |
299 size_t | |
300 ModelDataTableModel::getFrameForModelIndex(const QModelIndex &index) const | |
301 { | |
302 int row = index.row(); | |
303 if (m_rows.empty()) return 0; | |
304 if (row < 0) row == 0; | |
305 if (row > m_rows.size()-1) row = m_rows.size()-1; | |
306 return m_rows[row]; | |
307 } | |
308 | |
299 void | 309 void |
300 ModelDataTableModel::modelChanged() | 310 ModelDataTableModel::modelChanged() |
301 { | 311 { |
302 rebuildRowVector(); | 312 rebuildRowVector(); |
303 emit layoutChanged(); | 313 emit layoutChanged(); |