diff options
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index d8d1bfbfc..46147bfc7 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1,4 +1,5 @@ #include "diveplanner.h" +#include <QMouseEvent> DivePlanner* DivePlanner::instance() { @@ -8,4 +9,14 @@ DivePlanner* DivePlanner::instance() 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); +} + |