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

@ -10,11 +10,11 @@
struct dive;
struct plot_info;
class ToolTipItem : public ChartRectItem {
class ToolTipItem : public AnimatedChartRectItem {
public:
ToolTipItem(ChartView &view, double dpr);
void update(const dive *d, double dpr, int time, const plot_info &pInfo,
const std::vector<std::pair<QString, QPixmap>> &events, bool inPlanner);
const std::vector<std::pair<QString, QPixmap>> &events, bool inPlanner, int animSpeed);
private:
QFont font;
QFontMetrics fm;