summaryrefslogtreecommitdiffstats
path: root/qt-ui/configuredivecomputerdialog.h
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-10-27 22:12:45 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-27 15:41:51 -0700
commit0e3a9328bc10b59a4e4843819bad0b3a4d75c456 (patch)
tree1860e8f20b24eab7838761aa2c7a25cbbf0782f4 /qt-ui/configuredivecomputerdialog.h
parent49401eec0bc83bc852114eac0a6ec828016e9ae8 (diff)
downloadsubsurface-0e3a9328bc10b59a4e4843819bad0b3a4d75c456.tar.gz
Create a delegate for gas type columns
This creates a delegate for the type column to choose the type value for gases that is less confusing then the raw value. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/configuredivecomputerdialog.h')
-rw-r--r--qt-ui/configuredivecomputerdialog.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/qt-ui/configuredivecomputerdialog.h b/qt-ui/configuredivecomputerdialog.h
index 941feaa64..84c25406f 100644
--- a/qt-ui/configuredivecomputerdialog.h
+++ b/qt-ui/configuredivecomputerdialog.h
@@ -6,6 +6,27 @@
#include "ui_configuredivecomputerdialog.h"
#include "../libdivecomputer.h"
#include "configuredivecomputer.h"
+#include <QStyledItemDelegate>
+
+class GasTypeComboBoxItemDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+
+public:
+ enum computer_type {
+ OSTC3,
+ OSTC,
+ };
+
+ GasTypeComboBoxItemDelegate(QObject *parent = 0, computer_type type = OSTC3);
+ ~GasTypeComboBoxItemDelegate();
+
+ virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
+ virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
+private:
+ computer_type type;
+};
class ConfigureDiveComputerDialog : public QDialog
{