Add the ability to modify the cylinder use in the UI

Thanks to Tomaz for writing a first draft of the delegate.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-11-17 14:03:37 +00:00
parent 1739042f34
commit 0c3f13d128
5 changed files with 53 additions and 2 deletions

View file

@ -2,7 +2,7 @@
#define MODELDELEGATES_H
#include <QStyledItemDelegate>
class QComboBox;
#include <QComboBox>
class QPainter;
class DiveListDelegate : public QStyledItemDelegate {
@ -59,6 +59,15 @@ slots:
void revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint);
};
class TankUseDelegate : public QStyledItemDelegate {
Q_OBJECT
public:
explicit TankUseDelegate(QObject *parent = 0);
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual void setEditorData(QWidget * editor, const QModelIndex & index) const;
};
class WSInfoDelegate : public ComboBoxDelegate {
Q_OBJECT
public: