summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-08-30 07:14:30 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-08-30 07:14:30 -0300
commit69903903d213e45fe16f3b5a6acb52278eee9291 (patch)
treed6d67ff1771196962bc5e47da076ea0fd31654ca /qt-ui/modeldelegates.cpp
parent6c56f0795923453f2502637d6f7ddda59190bc2d (diff)
downloadsubsurface-69903903d213e45fe16f3b5a6acb52278eee9291.tar.gz
Started the work of Editable Model for the Planner
This commit is the start of the Editable Model work for the planner, it creates a new delegate and shares the code for the model that creates the gas types, so we only need to change in one place to add new gases. The table is already edition-enabled, but the outcome is still undone, next commit - put all together. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 998c246b8..31267810c 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -3,6 +3,7 @@
#include "../divelist.h"
#include "starwidget.h"
#include "models.h"
+#include "diveplanner.h"
#include <QtDebug>
#include <QPainter>
@@ -14,6 +15,7 @@
#include <QLineEdit>
#include <QKeyEvent>
#include <QAbstractItemView>
+#include <QStringListModel>
// Gets the index of the model in the currentRow and column.
// currCombo is defined below.
@@ -253,3 +255,15 @@ QWidget* WSInfoDelegate::createEditor(QWidget* parent, const QStyleOptionViewIte
currWeigth.weigth = ws->weight.grams;
return editor;
}
+
+void AirTypesDelegate::revertModelData(QWidget* widget, QAbstractItemDelegate::EndEditHint hint)
+{
+}
+
+void AirTypesDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
+{
+}
+
+AirTypesDelegate::AirTypesDelegate(QObject* parent) : ComboBoxDelegate(airTypes(), parent)
+{
+}