Added a new class to handle the DivePlanner dialog

Added a new class named DivePlanner that is a QDialog,
and renamed the old DivePlanner class to DivePlannerGraphics.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-06-20 18:40:59 -03:00
parent 8fcd465a65
commit fdd8a4811b
3 changed files with 122 additions and 21 deletions

View file

@ -3,6 +3,7 @@
#include <QGraphicsView>
#include <QGraphicsPathItem>
#include <QDialog>
class DiveHandler : public QGraphicsEllipseItem{
public:
@ -34,10 +35,10 @@ private:
double posEnd;
};
class DivePlanner : public QGraphicsView {
class DivePlannerGraphics : public QGraphicsView {
Q_OBJECT
public:
static DivePlanner *instance();
DivePlannerGraphics(QWidget* parent = 0);
protected:
virtual void mouseDoubleClickEvent(QMouseEvent* event);
virtual void showEvent(QShowEvent* event);
@ -51,7 +52,7 @@ protected:
bool isPointOutOfBoundaries(QPointF point);
private:
DivePlanner(QWidget* parent = 0);
void moveActiveHandler(QPointF pos);
QList<QGraphicsLineItem*> lines;
QList<DiveHandler *> handles;
@ -66,4 +67,19 @@ private:
QGraphicsSimpleTextItem *depthString;
};
namespace Ui{
class DivePlanner;
}
class DivePlanner : public QDialog{
Q_OBJECT
public:
static DivePlanner *instance();
struct dive* getDive();
private:
DivePlanner();
Ui::DivePlanner *ui;
};
#endif