diff options
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 135c21175..5c8973224 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -75,6 +75,8 @@ QVariant DivePlannerDisplay::data(const QModelIndex &index, int role) const } } else if (role == Qt::DecorationRole) { switch (index.column()) { + case REMOVE: + return QIcon(":trash"); } } else if (role == Qt::FontRole) { return defaultModelFont(); @@ -159,6 +161,15 @@ void DivePlannerDisplay::insertPoint(const struct computedPoint &p) computedPoints.append(p); } +void DivePlannerDisplay::remove(const QModelIndex &index) +{ + if (index.column() != REMOVE) + return; + + beginRemoveRows(QModelIndex(), index.row(), index.row()); + endRemoveRows(); +} + static DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance(); DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent), |