Added a 'remove' icon on the dive planner table.

Added a 'remove' icon on the dive planner table,
this makes the ui more consistent between the other
tables that also manages addition and removal of data.

the delete method is still unimplemented.
next - css.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-08-28 07:27:59 -03:00
parent 65ab236948
commit cfd17116eb
2 changed files with 6 additions and 1 deletions

View file

@ -886,6 +886,11 @@ QVariant DivePlannerPointsModel::data(const QModelIndex& index, int role) const
case DURATION: return p.time / 60;
}
}
if (role == Qt::DecorationRole){
switch(index.column()){
case REMOVE : return QIcon(":trash");
}
}
return QVariant();
}

View file

@ -21,7 +21,7 @@ class DivePlannerPointsModel : public QAbstractTableModel{
Q_OBJECT
public:
static DivePlannerPointsModel* instance();
enum Sections{DEPTH, DURATION, GAS, CCSETPOINT, COLUMNS};
enum Sections{REMOVE, DEPTH, DURATION, GAS, CCSETPOINT, COLUMNS};
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;