From e91a1fc26c6c0ac2efee0a13e7ab29b3caa61f0c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 26 Nov 2013 13:53:00 -0200 Subject: Fix ToolTip disappeared when resizing the ProfileWindow When resizing the ProfileWindow and the tooltip was out of boundaries, it was really out of boundaries and there was no way to get it back ( besides re-expanding the window. ) this patch moves the tooltip to (0,0) and don't save that position, so when the window is re-expanded, it will move to the correct location again Fixes #237 Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profilegraphics.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index f2d8e74df..7bd00c73f 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -232,9 +232,7 @@ void ProfileGraphicsView::mouseMoveEvent(QMouseEvent* event) return; toolTip->refresh(&gc, mapToScene(event->pos())); - QPoint toolTipPos = mapFromScene(toolTip->pos()); - scrollViewTo(event->pos()); if (zoomLevel == 0) @@ -1569,6 +1567,9 @@ void ToolTipItem::readPos() QPointF value = scene()->views().at(0)->mapToScene( s.value("tooltip_position").toPoint() ); + if (!scene()->sceneRect().contains(value)){ + value = QPointF(0,0); + } setPos(value); } -- cgit v1.2.3-70-g09d2