summaryrefslogtreecommitdiffstats
path: root/profile-widget/divehandler.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-11-25 18:30:49 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-12 15:52:40 -0800
commit3b2ae46eb81281b1e145fe58121b542ce30e3925 (patch)
treecc1c967901726edc017285824329884f09b32faa /profile-widget/divehandler.h
parentcd33d88768a14f1ce9651fbd80a40c89aaaec91f (diff)
downloadsubsurface-3b2ae46eb81281b1e145fe58121b542ce30e3925.tar.gz
profile: move DiveHandler to profile-widget folder
These are the small dots that describe dragable points on the profile when in the planner. It makes no sense to have them in desktop's planner-widget code. They belong to the profile. Therefore, move the code there and compile on mobile. Not everything can be compiled on mobile for now, but it is a start. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/divehandler.h')
-rw-r--r--profile-widget/divehandler.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/profile-widget/divehandler.h b/profile-widget/divehandler.h
new file mode 100644
index 000000000..ecd0248c8
--- /dev/null
+++ b/profile-widget/divehandler.h
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef DIVEHANDLER_HPP
+#define DIVEHANDLER_HPP
+
+#include <QGraphicsPathItem>
+#include <QElapsedTimer>
+
+class DiveHandler : public QObject, public QGraphicsEllipseItem {
+ Q_OBJECT
+public:
+ DiveHandler();
+
+protected:
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+signals:
+ void moved();
+ void clicked();
+ void released();
+private:
+ int parentIndex();
+public
+slots:
+ void selfRemove();
+ void changeGas();
+private:
+ QElapsedTimer t;
+};
+
+#endif