diff options
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r-- | qt-ui/models.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h index 62ae3913c..ded612bb9 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -38,18 +38,22 @@ private: class CylindersModel : public QAbstractTableModel { Q_OBJECT public: - enum Column {TYPE, SIZE, MAXPRESS, START, END, O2, HE}; + enum Column {REMOVE, TYPE, SIZE, MAXPRESS, START, END, O2, HE, COLUMNS}; explicit CylindersModel(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; + /*reimp*/ bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); void add(cylinder_t *cyl); void clear(); void update(); void setDive(struct dive *d); +public slots: + void remove(const QModelIndex& index); private: struct dive *current; @@ -61,16 +65,20 @@ private: class WeightModel : public QAbstractTableModel { Q_OBJECT public: - enum Column {TYPE, WEIGHT}; + enum Column {REMOVE, TYPE, WEIGHT, COLUMNS}; /*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; + /*reimp*/ bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); void add(weightsystem_t *weight); void clear(); void update(); void setDive(struct dive *d); +public slots: + void remove(const QModelIndex& index); private: struct dive *current; |