Add weightsystem delegate to enable editing of weightsystem

This is very much analogous to the way cylinders are implemented.
That means that just like with cylinders, if the user enters a new type
and hits 'tab' before hitting 'enter', Subsurface will crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-05-23 18:40:16 -07:00
parent ecbcd4db47
commit 01a3bd2cc6
5 changed files with 218 additions and 9 deletions

View file

@ -22,4 +22,13 @@ public:
virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
};
class WSInfoDelegate : public QStyledItemDelegate{
Q_OBJECT
public:
explicit WSInfoDelegate(QObject* parent = 0);
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;
};
#endif