mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
49401eec0b
commit
0e3a9328bc
2 changed files with 62 additions and 0 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue