diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-02-05 15:25:24 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-06 06:29:55 -0800 |
commit | ed230f8aacb2d1bc4076f927240998ca9f1fa8b6 (patch) | |
tree | cb6c839c632ba83e401044a0a7a8720809b20902 /qt-ui/profile | |
parent | 40cb57b2020321a0e3c898dac2c54daab3f22026 (diff) | |
download | subsurface-ed230f8aacb2d1bc4076f927240998ca9f1fa8b6.tar.gz |
Make the Tooltip Item work on the new profile.
Just refresh the tooltip item.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/divetooltipitem.cpp | 4 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
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 <QGraphicsScene> #include <QSettings> #include <QGraphicsView> +#include <QDebug> #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); |