summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/diveplanner.cpp15
-rw-r--r--qt-ui/diveplanner.h3
2 files changed, 17 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index fa7be75b3..33a759f1d 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -39,6 +39,16 @@ DivePlanner::DivePlanner(QWidget* parent): QGraphicsView(parent), activeDraggedH
depthLine->setOrientation(Qt::Vertical);
depthLine->updateTicks();
scene()->addItem(depthLine);
+
+ timeString = new QGraphicsSimpleTextItem();
+ timeString->setFlag(QGraphicsItem::ItemIgnoresTransformations);
+ scene()->addItem(timeString);
+
+ depthString = new QGraphicsSimpleTextItem();
+ depthString->setFlag(QGraphicsItem::ItemIgnoresTransformations);
+ scene()->addItem(depthString);
+
+
}
void DivePlanner::mouseDoubleClickEvent(QMouseEvent* event)
@@ -127,10 +137,13 @@ void DivePlanner::mouseMoveEvent(QMouseEvent* event)
verticalLine->setLine(mappedPos.x(), 0, mappedPos.x(), 100);
horizontalLine->setLine(0, mappedPos.y(), 100, mappedPos.y());
+ depthString->setText(QString::number(depthLine->valueAt(mappedPos)));
+ depthString->setPos(0, mappedPos.y());
+ timeString->setText(QString::number( (int) timeLine->valueAt(mappedPos)) + "min");
+ timeString->setPos(mappedPos.x()+1, 90);
if(activeDraggedHandler)
moveActiveHandler(mappedPos);
-
if (!handles.count())
return;
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index f7af25113..0e7f6f4b2 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -63,7 +63,10 @@ private:
DiveHandler *activeDraggedHandler;
Ruler *timeLine;
+ QGraphicsSimpleTextItem *timeString;
+
Ruler *depthLine;
+ QGraphicsSimpleTextItem *depthString;
};
#endif