summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-14 17:39:35 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-15 09:19:14 +0900
commit96d5687ab89edd7163493faf212ddcb119e93d8c (patch)
tree6d3d148d776a134172d612fa13fe00223aaecdbc /qt-ui/models.h
parentb77d990ed6892081f7c1e0df62631b57aad3b59f (diff)
downloadsubsurface-96d5687ab89edd7163493faf212ddcb119e93d8c.tar.gz
Correctly handle changes on the CylinderModel to update the AirModel.
What happened before was that the AirTypes model was only being updated when the user requested to change the air by clicking directly on the Air, in the planner ( but not on the Air Table. ). This fixes it by calling 'repopulate' whenever the cylinder model changes ( by adding, removing and changing something.) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.h')
-rw-r--r--qt-ui/models.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/models.h b/qt-ui/models.h
index 8302acefa..88e76a46f 100644
--- a/qt-ui/models.h
+++ b/qt-ui/models.h
@@ -10,6 +10,7 @@
#include <QAbstractTableModel>
#include <QCoreApplication>
#include <QStringList>
+#include <QStringListModel>
#include "../dive.h"
#include "../divelist.h"
@@ -298,4 +299,13 @@ public:
void setDive(struct dive *divePtr);
};
+class GasSelectionModel : public QStringListModel{
+ Q_OBJECT
+public:
+ static GasSelectionModel* instance();
+ Qt::ItemFlags flags(const QModelIndex& index) const;
+public slots:
+ void repopulate();
+};
+
#endif