subsurface/qt-ui/diveplanner.h
Tomaz Canabrava 021a6a076e Created a class DiveHandle to make drag drop work.
Create d a class DiveHandle to make drag drop works,
it has a from and to Lines, and it will move them
around.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-20 14:29:32 -03:00

34 lines
843 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);
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;
};
#endif