subsurface/profile-widget/diveeventitem.h
Berthold Stoeger 74244b3cfe Profile: take int instead of bool in DiveEventItem::recalculatePos
The goal here is to slowly make animation speed a variable of the
profile widget, not of the global preferences. Currently the code
does some trickeries with setting / unsetting the global animation
speed.

Start by not taking a bool "instant" but a speed in
DiveEventItem::recalculatePos().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-07-12 09:59:28 +02:00

37 lines
973 B
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef DIVEEVENTITEM_H
#define DIVEEVENTITEM_H
#include "divepixmapitem.h"
class DiveCartesianAxis;
class DivePlotDataModel;
struct event;
class DiveEventItem : public DivePixmapItem {
Q_OBJECT
public:
DiveEventItem(QGraphicsItem *parent = 0);
~DiveEventItem();
void setEvent(struct event *ev, struct gasmix lastgasmix);
struct event *getEvent();
void eventVisibilityChanged(const QString &eventName, bool visible);
void setVerticalAxis(DiveCartesianAxis *axis, int speed);
void setHorizontalAxis(DiveCartesianAxis *axis);
void setModel(DivePlotDataModel *model);
bool shouldBeHidden();
public
slots:
void recalculatePos(int animationSpeed);
private:
void setupToolTipString(struct gasmix lastgasmix);
void setupPixmap(struct gasmix lastgasmix);
int depthAtTime(int time);
DiveCartesianAxis *vAxis;
DiveCartesianAxis *hAxis;
DivePlotDataModel *dataModel;
struct event *internalEvent;
};
#endif // DIVEEVENTITEM_H