summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-14 23:29:36 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-15 13:15:35 +0900
commitcec30c27d936a45d87e707363f824653949a5c02 (patch)
tree68fdfdce95f9a9f5914d4e6b61cf73f2ae936c70 /qt-ui/diveplanner.h
parent3302ee11c1fc215b979da7a403dc5468da68e84c (diff)
downloadsubsurface-cec30c27d936a45d87e707363f824653949a5c02.tar.gz
Enable a context menu to remove dive handlers.
This commit enables a context menu to remove dive handlers, because it was hard to find that ctrl+click selected it, then a delete button press removed it. it's better now. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.h')
-rw-r--r--qt-ui/diveplanner.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index 232b8f0fe..bd9b254d1 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -95,11 +95,15 @@ private:
QGraphicsSimpleTextItem *text;
};
-class DiveHandler : public QGraphicsEllipseItem{
+class DiveHandler : public QObject, public QGraphicsEllipseItem{
+Q_OBJECT
public:
DiveHandler();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* event);
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent* event);
+public slots:
+ void selfRemove();
};
class Ruler : public QGraphicsLineItem{
@@ -118,7 +122,6 @@ public:
qreal posAtValue(qreal value);
void setColor(const QColor& color);
void setTextColor(const QColor& color);
-
private:
Qt::Orientation orientation;
QList<QGraphicsLineItem*> ticks;
@@ -210,6 +213,8 @@ private:
int minMinutes; // this holds the minimum duration of the dive.
int dpMaxTime; // this is the time of the dive calculated by the deco.
+
+ friend class DiveHandler;
};
#include "ui_diveplanner.h"