diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-10-27 22:12:46 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-27 15:41:55 -0700 |
commit | ee7c86f206f5465df0f0ade08b13da3b8062e67f (patch) | |
tree | 05d6319263f40e2e48940fcd1e51d463b28f06c3 /qt-ui/configuredivecomputerdialog.h | |
parent | 0e3a9328bc10b59a4e4843819bad0b3a4d75c456 (diff) | |
download | subsurface-ee7c86f206f5465df0f0ade08b13da3b8062e67f.tar.gz |
Create a delegate for depth and gas components
This creates a delegate to simplify the handling of gas components and
the change depth.
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.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/qt-ui/configuredivecomputerdialog.h b/qt-ui/configuredivecomputerdialog.h index 84c25406f..89efee622 100644 --- a/qt-ui/configuredivecomputerdialog.h +++ b/qt-ui/configuredivecomputerdialog.h @@ -8,6 +8,26 @@ #include "configuredivecomputer.h" #include <QStyledItemDelegate> +class GasSpinBoxItemDelegate : public QStyledItemDelegate +{ + Q_OBJECT + +public: + enum column_type { + PERCENT, + DEPTH, + }; + + GasSpinBoxItemDelegate(QObject *parent = 0, column_type type = PERCENT); + ~GasSpinBoxItemDelegate(); + + 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: + column_type type; +}; + class GasTypeComboBoxItemDelegate : public QStyledItemDelegate { Q_OBJECT |