summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-11 11:04:27 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-11 11:04:27 -0300
commita4efa8c444da9de1dd68125dca777d5bc8cbc693 (patch)
treefa647229c970c403d10732c9eb206d6a6fb9f7d7 /qt-ui/models.h
parent26c87fafc2cd2c0329b780699ba90f21a5592031 (diff)
downloadsubsurface-a4efa8c444da9de1dd68125dca777d5bc8cbc693.tar.gz
Second model converted to be less boilerplated.
Second model converted to be less boilerplated, there are right now 7 models that will need to be ported. each model can remove around 30 to 40 LOC, so this is not such a bigger improvement, but it's an 'keeping an eye on the future'. Also fixed a bug where the returned value was dummy. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r--qt-ui/models.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h
index 24f829add..5e3d07121 100644
--- a/qt-ui/models.h
+++ b/qt-ui/models.h
@@ -109,14 +109,12 @@ private:
/* Encapsulation of the Weight Model, that represents
* the current weights on a dive. */
-class WeightModel : public QAbstractTableModel {
+class WeightModel : public CleanerTableModel {
Q_OBJECT
public:
- enum Column {REMOVE, TYPE, WEIGHT, COLUMNS};
+ enum Column {REMOVE, TYPE, WEIGHT};
explicit WeightModel(QObject *parent = 0);
- /*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*/ Qt::ItemFlags flags(const QModelIndex& index) const;