mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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 <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));
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue