diff data/model/ModelDataTableModel.h @ 428:3e1d190048f4

* a bit of progress on retaining current row when sorting changes &c
author Chris Cannam
date Tue, 17 Jun 2008 16:07:56 +0000
parents 72ec275e458b
children 304fd0223fa6
line wrap: on
line diff
--- a/data/model/ModelDataTableModel.h	Mon Jun 16 14:48:42 2008 +0000
+++ b/data/model/ModelDataTableModel.h	Tue Jun 17 16:07:56 2008 +0000
@@ -54,11 +54,17 @@
     QModelIndex getModelIndexForFrame(size_t frame) const;
     size_t getFrameForModelIndex(const QModelIndex &) const;
 
+    QModelIndex getModelIndexForRow(int row) const;
+
     void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
 
+    void setCurrentRow(int row);
+    int getCurrentRow();
+
 signals:
     void frameSelected(size_t);
     void addCommand(Command *);
+    void currentChanged(const QModelIndex &);
 
 protected slots:
     void modelChanged();
@@ -68,6 +74,7 @@
     TabularModel *m_model;
     int m_sortColumn;
     Qt::SortOrder m_sortOrdering;
+    int m_currentRow;
     typedef std::vector<int> RowList;
     mutable RowList m_sort;
     mutable RowList m_rsort;
@@ -76,6 +83,7 @@
     void resort() const;
     void resortNumeric() const;
     void resortAlphabetical() const;
+    void clearSort();
 };
 
 #endif