summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-22 08:47:41 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-22 08:47:41 -0700
commit9946fe97c0d0bf774473238170fce05bcac4fc1e (patch)
treeea8d02743863210667e7b05284e072d9328a7a4e /qt-ui/models.h
parentd8673f986703439ceee6b037c14ff10526e6714a (diff)
parent75956f0f9149d7483ce0771df682d90e2fc9b923 (diff)
downloadsubsurface-9946fe97c0d0bf774473238170fce05bcac4fc1e.tar.gz
Merge branch 'randomFixes' of https://github.com/tcanabrava/subsurface
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r--qt-ui/models.h12
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;