summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
blob: 46147bfc7fe2845d2d59d71b2e941a878b4d901c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "diveplanner.h"
#include <QMouseEvent>

DivePlanner* DivePlanner::instance()
{
	static DivePlanner *self = new DivePlanner();
	return self;
}

DivePlanner::DivePlanner(QWidget* parent): QGraphicsView(parent)
{
	setScene( new QGraphicsScene());
	scene()->setSceneRect(0,0,100,100);
}

void DivePlanner::mouseDoubleClickEvent(QMouseEvent* event)
{
	QGraphicsEllipseItem *item = new QGraphicsEllipseItem(-10,-10,20,20);
	item->setPos( mapToScene(event->pos()));
    scene()->addItem(item);
}