From ed230f8aacb2d1bc4076f927240998ca9f1fa8b6 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 5 Feb 2014 15:25:24 -0200 Subject: Make the Tooltip Item work on the new profile. Just refresh the tooltip item. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/divetooltipitem.cpp | 4 +++- qt-ui/profile/profilewidget2.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index ffe22a820..ca355b710 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #define PORT_IN_PROGRESS 1 #ifdef PORT_IN_PROGRESS @@ -223,7 +224,8 @@ void ToolTipItem::setTimeAxis(DiveCartesianAxis* axis) void ToolTipItem::refresh(const QPointF& pos) { clear(); - int time = timeAxis->posAtValue( pos.x() ); + int time = timeAxis->valueAt( pos ); + qDebug() << "time" << time; char buffer[500]; get_plot_details_new(&pInfo, time, buffer, 500); addToolTip(QString(buffer)); diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 400fa59aa..b949cd9f0 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -525,7 +525,7 @@ void ProfileWidget2::scrollViewTo(const QPoint& pos) void ProfileWidget2::mouseMoveEvent(QMouseEvent* event) { - //toolTipItem->refresh(&gc, mapToScene(event->pos())); + toolTipItem->refresh(mapToScene(event->pos())); QPoint toolTipPos = mapFromScene(toolTipItem->pos()); if (zoomLevel == 0) { QGraphicsView::mouseMoveEvent(event); -- cgit v1.2.3-70-g09d2