summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-01 23:54:38 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-01 23:54:38 -0300
commite5ad47e459af1d937d26782ce8308dbd67ecec4b (patch)
tree0340be89b69de619623db519c7f8287636646ee0 /qt-ui/models.h
parent764a863082f9337156fc4bcf5c0ecc6ae3d149d6 (diff)
parent00d85313827af88ae5f35b2391ffa6964e81da49 (diff)
downloadsubsurface-e5ad47e459af1d937d26782ce8308dbd67ecec4b.tar.gz
Merge branch 'Qt' into RenderStarsOnTable
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r--qt-ui/models.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h
index 7bc7578b8..52a3498df 100644
--- a/qt-ui/models.h
+++ b/qt-ui/models.h
@@ -50,28 +50,29 @@ public:
void clear();
void update();
private:
- dive *currentDive;
-
/* Since the dive doesn`t stores the number of cylinders that
* it has ( max 8 ) and since I don`t want to make a
* model-for-each-dive, let`s hack this here instead. */
- QMap<dive*, int> usedRows;
+ QMap<struct dive *, int> usedRows;
};
/* Encapsulation of the Weight Model, that represents
* the current weights on a dive. */
class WeightModel : public QAbstractTableModel {
+Q_OBJECT
+public:
enum Column {TYPE, WEIGHT};
/*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;
- void add(weight_t *weight);
+ void add(weightsystem_t *weight);
void clear();
void update();
private:
- int rows;
+ /* Remember the number of rows in a dive */
+ QMap<struct dive *, int> usedRows;
};
/*! An AbstractItemModel for recording dive trip information such as a list of dives.