aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Lakshman <acrlakshman@gmail.com>2014-04-02 08:51:10 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-04-02 10:21:02 -0700
commit4722104e1c762a01b521f0dce1b2cbb9bf76891e (patch)
tree6c8b15cdf34783608cb57aac5e995e815cde026a /qt-ui/diveplanner.cpp
parentb629905ec5c099cb83eafff8c0de1e5e5793f563 (diff)
downloadsubsurface-4722104e1c762a01b521f0dce1b2cbb9bf76891e.tar.gz
Add missing REMOVE slot
Model derived from tableview is expected to have remove slot, which is missing in DivePlannerDisplay currently. This patch fixes the annoying warning message while starting Subsurface because of not including remove slot. Currently there is lot of work to do, that either requires modifying the model to skip 'remove' slot or find a way to make them inactive. Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp11
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),