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 <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-11-26 13:53:00 -02:00 committed by Dirk Hohndel
parent 45f716f857
commit e91a1fc26c

View file

@ -232,9 +232,7 @@ void ProfileGraphicsView::mouseMoveEvent(QMouseEvent* event)
return; return;
toolTip->refresh(&gc, mapToScene(event->pos())); toolTip->refresh(&gc, mapToScene(event->pos()));
QPoint toolTipPos = mapFromScene(toolTip->pos()); QPoint toolTipPos = mapFromScene(toolTip->pos());
scrollViewTo(event->pos()); scrollViewTo(event->pos());
if (zoomLevel == 0) if (zoomLevel == 0)
@ -1569,6 +1567,9 @@ void ToolTipItem::readPos()
QPointF value = scene()->views().at(0)->mapToScene( QPointF value = scene()->views().at(0)->mapToScene(
s.value("tooltip_position").toPoint() s.value("tooltip_position").toPoint()
); );
if (!scene()->sceneRect().contains(value)){
value = QPointF(0,0);
}
setPos(value); setPos(value);
} }