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