summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-06-20 17:54:36 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-06-20 17:54:36 -0300
commitcbdd78c0fca06645248dafe3999bbabd91c48449 (patch)
tree8894d8b704909095b88aad322b9b8bbdffbb81a2 /qt-ui
parent2d683b66a8a7d514c8cd766303832876ccbab9bb (diff)
downloadsubsurface-cbdd78c0fca06645248dafe3999bbabd91c48449.tar.gz
Added text to the rules so the user knows what's happening at that point.
Added text to the rules, so the user knows what's happening at that point The text will move left / right ( for time ) and up / down ( for depth ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui')
-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