mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Added drag and drop code to the dive plan, it can move the user- inputted data, but will not touch the computer generated ones. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
38 lines
991 B
C++
38 lines
991 B
C++
#ifndef DIVEPLANNER_H
|
|
#define DIVEPLANNER_H
|
|
|
|
#include <QGraphicsView>
|
|
#include <QGraphicsPathItem>
|
|
|
|
class DiveHandler : public QGraphicsEllipseItem{
|
|
public:
|
|
DiveHandler();
|
|
|
|
QGraphicsLineItem *from;
|
|
QGraphicsLineItem *to;
|
|
};
|
|
class DivePlanner : public QGraphicsView {
|
|
Q_OBJECT
|
|
public:
|
|
static DivePlanner *instance();
|
|
protected:
|
|
virtual void mouseDoubleClickEvent(QMouseEvent* event);
|
|
virtual void showEvent(QShowEvent* event);
|
|
virtual void resizeEvent(QResizeEvent* event);
|
|
virtual void mouseMoveEvent(QMouseEvent* event);
|
|
virtual void mousePressEvent(QMouseEvent* event);
|
|
virtual void mouseReleaseEvent(QMouseEvent* event);
|
|
|
|
void clear_generated_deco();
|
|
void create_deco_stop();
|
|
bool isPointOutOfBoundaries(QPointF point);
|
|
|
|
private:
|
|
DivePlanner(QWidget* parent = 0);
|
|
QList<QGraphicsLineItem*> lines;
|
|
QList<DiveHandler *> handles;
|
|
QGraphicsLineItem *verticalLine;
|
|
QGraphicsLineItem *horizontalLine;
|
|
DiveHandler *activeDraggedHandler;
|
|
};
|
|
#endif
|