summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetooltipitem.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-13 10:23:20 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-13 10:28:15 -0700
commitae2f18678d72ab700b09435b53b7d4ba6292d466 (patch)
treedc61149a43d0a88b4298cca12e9c162367c3d484 /qt-ui/profile/divetooltipitem.cpp
parent13e2210d75bb29a78fa1d08c79b5930a7fbaa3e4 (diff)
downloadsubsurface-ae2f18678d72ab700b09435b53b7d4ba6292d466.tar.gz
New profile: fix Information overlay location
By simply storing the coordinates based on the scene (instead of trying to map them to real coordinates) the overlay position is correctly restored. Also remove the redundant positioning before readPos is called. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divetooltipitem.cpp')
-rw-r--r--qt-ui/profile/divetooltipitem.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp
index c11266a5a..0e68685b9 100644
--- a/qt-ui/profile/divetooltipitem.cpp
+++ b/qt-ui/profile/divetooltipitem.cpp
@@ -184,10 +184,9 @@ void ToolTipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void ToolTipItem::persistPos()
{
- QPoint currentPos = scene()->views().at(0)->mapFromScene(pos());
QSettings s;
s.beginGroup("ProfileMap");
- s.setValue("tooltip_position", currentPos);
+ s.setValue("tooltip_position", pos());
s.endGroup();
}
@@ -195,8 +194,7 @@ void ToolTipItem::readPos()
{
QSettings s;
s.beginGroup("ProfileMap");
- QPointF value = scene()->views().at(0)->mapToScene(
- s.value("tooltip_position").toPoint());
+ QPointF value = s.value("tooltip_position").toPoint();
if (!scene()->sceneRect().contains(value)) {
value = QPointF(0, 0);
}