profile: implement animation of the tooltip item

To do so, generalize the animation routine.

This seems to expose a QtQuick bug: we get spurious
hover-events when the tooltip item is updated in the
animation. We have to check for that to prevent
en endless loop (until the user moves the mouse out
of the profile window).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2023-07-06 16:08:19 +02:00
parent 06b0a7eeae
commit d0c26f42d7
6 changed files with 120 additions and 34 deletions

View file

@ -74,7 +74,10 @@ private:
void mouseReleaseEvent(QMouseEvent *event) override;
ChartItemPtr<ToolTipItem> tooltip;
void updateTooltip(QPointF pos, bool plannerMode);
void updateTooltip(QPointF pos, bool plannerMode, int animSpeed);
std::unique_ptr<ProfileAnimation> tooltip_animation;
QPointF previousHoveMovePosition;
// For mobile
int getDiveId() const;