aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-11 11:42:33 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-11 11:42:33 -0300
commitbeb40ae4943cc76017c38eee678cae386f51854c (patch)
treedc0f739992bc41d9bedd979f5c7341eef75bd92e /qt-ui/models.h
parentfac316865c083789eb1254abb0ddf2f056a09036 (diff)
downloadsubsurface-beb40ae4943cc76017c38eee678cae386f51854c.tar.gz
Finish clearing up the TableModels
There are other models ( Tree Models and Model Items ) that are not affected by this commits, this is already a good cleanup but it can be extended to also fix those two other possibilities. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r--qt-ui/models.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h
index 3f73c40ef..cfc6771bb 100644
--- a/qt-ui/models.h
+++ b/qt-ui/models.h
@@ -32,7 +32,7 @@ private:
/* Encapsulates the tank_info global variable
* to show on Qt's Model View System.*/
-class TankInfoModel : public QAbstractTableModel {
+class TankInfoModel : public CleanerTableModel {
Q_OBJECT
public:
static TankInfoModel* instance();
@@ -40,8 +40,6 @@ public:
enum Column {DESCRIPTION, ML, BAR};
TankInfoModel();
- /*reimp*/ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
- /*reimp*/ int columnCount(const QModelIndex& parent = QModelIndex()) const;
/*reimp*/ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
/*reimp*/ int rowCount(const QModelIndex& parent = QModelIndex()) const;
/*reimp*/ bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex());
@@ -207,14 +205,12 @@ private:
Layout currentLayout;
};
-class DiveComputerModel : public QAbstractTableModel
+class DiveComputerModel : public CleanerTableModel
{
Q_OBJECT
public:
- enum {REMOVE, MODEL, ID, NICKNAME, COLUMNS};
+ enum {REMOVE, MODEL, ID, NICKNAME};
DiveComputerModel(QMultiMap<QString, DiveComputerNode> &dcMap, QObject *parent = 0);
- virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
- virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
virtual Qt::ItemFlags flags(const QModelIndex& index) const;