diff data/model/TabularModel.h @ 422:4caa28a0a8a2

* sorting arbitrary columns in data editor
author Chris Cannam
date Thu, 12 Jun 2008 09:03:00 +0000
parents 397fe91dc8e0
children eafef13bb0b3
line wrap: on
line diff
--- a/data/model/TabularModel.h	Wed Jun 11 17:00:04 2008 +0000
+++ b/data/model/TabularModel.h	Thu Jun 12 09:03:00 2008 +0000
@@ -38,13 +38,17 @@
     virtual int getColumnCount() const = 0;
 
     virtual QString getHeading(int column) const = 0;
+
+    enum { SortRole = Qt::UserRole };
+    enum SortType { SortNumeric, SortAlphabetical };
+
     virtual QVariant getData(int row, int column, int role) const = 0;
+    virtual bool isColumnTimeValue(int col) const = 0;
+    virtual SortType getSortType(int col) const = 0;
 
     virtual long getFrameForRow(int row) const = 0;
     virtual int getRowForFrame(long frame) const = 0;
 
-    virtual bool isColumnTimeValue(int col) const = 0;
-
     virtual bool isEditable() const { return false; }
     virtual Command *getSetDataCommand(int row, int column, const QVariant &, int role) const { return 0; }
 };