mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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:
parent
40cb57b202
commit
ed230f8aac
2 changed files with 4 additions and 2 deletions
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue