From c9869406301ff72f76b399097f0845fc1102ced1 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Wed, 17 Oct 2018 11:28:33 +0200 Subject: Profile: show correct info box for multiple DCs Update the dive info box when toggling the chosen DC using the keyboard. The keyboard toggle does not generate a mouse move event, so this data was not repainted. For this, a sub-optimization of not repainting when not moving the mouse had to be removed. This does not impact ant performance as 99.9999% of the calls of the repaint are caused by mouse movement anyway. Fixes: #1802 Signed-off-by: Jan Mulder --- profile-widget/profilewidget2.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'profile-widget/profilewidget2.cpp') diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 3b932144b..846465672 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -828,6 +828,8 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures) clearPictures(); else plotPictures(); + + toolTipItem->refresh(mapToScene(mapFromGlobal(QCursor::pos()))); #endif // OK, how long did this take us? Anything above the second is way too long, @@ -1066,7 +1068,8 @@ void ProfileWidget2::scrollViewTo(const QPoint &pos) void ProfileWidget2::mouseMoveEvent(QMouseEvent *event) { QPointF pos = mapToScene(event->pos()); - toolTipItem->refresh(pos); + toolTipItem->refresh(mapToScene(mapFromGlobal(QCursor::pos()))); + if (zoomLevel == 0) { QGraphicsView::mouseMoveEvent(event); } else { -- cgit v1.2.3-70-g09d2