summaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-09 18:11:56 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-10 15:57:39 -0800
commit54e8fe5d9e588c3345ded27982edaf72654fc8d1 (patch)
tree14460c74f1a9bf9cdd228a933fac509bf39043a2 /profile-widget/profilewidget2.cpp
parent193513a61fc7fcfb31c1cb969f7fe05452abd67c (diff)
downloadsubsurface-54e8fe5d9e588c3345ded27982edaf72654fc8d1.tar.gz
profile: pass dive to ToolTipItem::refresh()
Don't access the global displayed_dive variable in a step to make the profile reentrant. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r--profile-widget/profilewidget2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 7397d1648..49f99d20c 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -809,7 +809,7 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
else
plotPicturesInternal(d, instant);
- toolTipItem->refresh(mapToScene(mapFromGlobal(QCursor::pos())));
+ toolTipItem->refresh(&displayed_dive, mapToScene(mapFromGlobal(QCursor::pos())));
#endif
// OK, how long did this take us? Anything above the second is way too long,
@@ -1025,7 +1025,7 @@ void ProfileWidget2::scrollViewTo(const QPoint &pos)
void ProfileWidget2::mouseMoveEvent(QMouseEvent *event)
{
QPointF pos = mapToScene(event->pos());
- toolTipItem->refresh(mapToScene(mapFromGlobal(QCursor::pos())));
+ toolTipItem->refresh(&displayed_dive, mapToScene(mapFromGlobal(QCursor::pos())));
if (zoomLevel == 0) {
QGraphicsView::mouseMoveEvent(event);