From 3b2ae46eb81281b1e145fe58121b542ce30e3925 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 25 Nov 2020 18:30:49 +0100 Subject: 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 --- profile-widget/divehandler.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 profile-widget/divehandler.h (limited to 'profile-widget/divehandler.h') 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 +#include + +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 -- cgit v1.2.3-70-g09d2