2020-11-25 17:30:49 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef DIVEHANDLER_HPP
|
|
|
|
#define DIVEHANDLER_HPP
|
|
|
|
|
|
|
|
#include <QGraphicsPathItem>
|
|
|
|
#include <QElapsedTimer>
|
|
|
|
|
2021-01-09 20:18:37 +00:00
|
|
|
struct dive;
|
|
|
|
|
2020-11-25 17:30:49 +00:00
|
|
|
class DiveHandler : public QObject, public QGraphicsEllipseItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-01-09 20:18:37 +00:00
|
|
|
DiveHandler(const struct dive *d);
|
2020-11-25 17:30:49 +00:00
|
|
|
|
|
|
|
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:
|
2021-01-09 20:18:37 +00:00
|
|
|
const struct dive *dive;
|
2020-11-25 17:30:49 +00:00
|
|
|
QElapsedTimer t;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|