aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-23 15:33:20 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-23 15:33:20 -0300
commitbabbfa9204b45d459227bdde0ff63469244b1c39 (patch)
tree888bcba51a30c37b608d9c55823fec0571876c82 /qt-ui/modeldelegates.h
parentc917a99eb2973701a79ba8bdb6002bb6ec0ad880 (diff)
downloadsubsurface-babbfa9204b45d459227bdde0ff63469244b1c39.tar.gz
Added support for Completing on the Cylinder Type delegate
I had to immprove the TankInfoModel with two new methods, insertRows and setData, because the delegate used this model to show what kind of Tanks we are offering. Since the user can enter a new type of Tank, it's important to add this tank to all lists using the delegates. I Also added two new methods on the delegate itself, to correctly shows the data, and set the data on the model. This also will help dirk with a working example on how to edit things while using a delegate. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/modeldelegates.h')
-rw-r--r--qt-ui/modeldelegates.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/modeldelegates.h b/qt-ui/modeldelegates.h
index baf7d50c3..eb78d12b6 100644
--- a/qt-ui/modeldelegates.h
+++ b/qt-ui/modeldelegates.h
@@ -18,6 +18,8 @@ class TankInfoDelegate : public QStyledItemDelegate{
public:
explicit TankInfoDelegate(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