Mercurial > hg > svcore
diff 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 |
line wrap: on
line diff
--- a/data/model/ModelDataTableModel.cpp Wed Jun 11 12:53:20 2008 +0000 +++ b/data/model/ModelDataTableModel.cpp Wed Jun 11 12:54:18 2008 +0000 @@ -296,6 +296,16 @@ return createIndex(dist, 0, 0); } +size_t +ModelDataTableModel::getFrameForModelIndex(const QModelIndex &index) const +{ + int row = index.row(); + if (m_rows.empty()) return 0; + if (row < 0) row == 0; + if (row > m_rows.size()-1) row = m_rows.size()-1; + return m_rows[row]; +} + void ModelDataTableModel::modelChanged() {