comparison 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
comparison
equal deleted inserted replaced
421:397fe91dc8e0 422:4caa28a0a8a2
36 public: 36 public:
37 virtual int getRowCount() const = 0; 37 virtual int getRowCount() const = 0;
38 virtual int getColumnCount() const = 0; 38 virtual int getColumnCount() const = 0;
39 39
40 virtual QString getHeading(int column) const = 0; 40 virtual QString getHeading(int column) const = 0;
41
42 enum { SortRole = Qt::UserRole };
43 enum SortType { SortNumeric, SortAlphabetical };
44
41 virtual QVariant getData(int row, int column, int role) const = 0; 45 virtual QVariant getData(int row, int column, int role) const = 0;
46 virtual bool isColumnTimeValue(int col) const = 0;
47 virtual SortType getSortType(int col) const = 0;
42 48
43 virtual long getFrameForRow(int row) const = 0; 49 virtual long getFrameForRow(int row) const = 0;
44 virtual int getRowForFrame(long frame) const = 0; 50 virtual int getRowForFrame(long frame) const = 0;
45
46 virtual bool isColumnTimeValue(int col) const = 0;
47 51
48 virtual bool isEditable() const { return false; } 52 virtual bool isEditable() const { return false; }
49 virtual Command *getSetDataCommand(int row, int column, const QVariant &, int role) const { return 0; } 53 virtual Command *getSetDataCommand(int row, int column, const QVariant &, int role) const { return 0; }
50 }; 54 };
51 55