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>
This commit is contained in:
Tomaz Canabrava 2014-02-05 15:25:24 -02:00 committed by Dirk Hohndel
parent 40cb57b202
commit ed230f8aac
2 changed files with 4 additions and 2 deletions

View file

@ -8,6 +8,7 @@
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QSettings> #include <QSettings>
#include <QGraphicsView> #include <QGraphicsView>
#include <QDebug>
#define PORT_IN_PROGRESS 1 #define PORT_IN_PROGRESS 1
#ifdef PORT_IN_PROGRESS #ifdef PORT_IN_PROGRESS
@ -223,7 +224,8 @@ void ToolTipItem::setTimeAxis(DiveCartesianAxis* axis)
void ToolTipItem::refresh(const QPointF& pos) void ToolTipItem::refresh(const QPointF& pos)
{ {
clear(); clear();
int time = timeAxis->posAtValue( pos.x() ); int time = timeAxis->valueAt( pos );
qDebug() << "time" << time;
char buffer[500]; char buffer[500];
get_plot_details_new(&pInfo, time, buffer, 500); get_plot_details_new(&pInfo, time, buffer, 500);
addToolTip(QString(buffer)); addToolTip(QString(buffer));

View file

@ -525,7 +525,7 @@ void ProfileWidget2::scrollViewTo(const QPoint& pos)
void ProfileWidget2::mouseMoveEvent(QMouseEvent* event) void ProfileWidget2::mouseMoveEvent(QMouseEvent* event)
{ {
//toolTipItem->refresh(&gc, mapToScene(event->pos())); toolTipItem->refresh(mapToScene(event->pos()));
QPoint toolTipPos = mapFromScene(toolTipItem->pos()); QPoint toolTipPos = mapFromScene(toolTipItem->pos());
if (zoomLevel == 0) { if (zoomLevel == 0) {
QGraphicsView::mouseMoveEvent(event); QGraphicsView::mouseMoveEvent(event);