profile: pass event at construction time to DiveEventItem

There is no point in having a dive event without an event.
Let's pass the event at construction time to avoid having
to handle "invalid" events.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-06-05 09:05:46 +02:00 committed by Dirk Hohndel
parent e42fc1a1e9
commit c93fb83edf
3 changed files with 9 additions and 20 deletions

View file

@ -11,9 +11,8 @@ struct event;
class DiveEventItem : public DivePixmapItem {
Q_OBJECT
public:
DiveEventItem(QGraphicsItem *parent = 0);
DiveEventItem(const struct dive *d, struct event *ev, struct gasmix lastgasmix, QGraphicsItem *parent = 0);
~DiveEventItem();
void setEvent(const struct dive *d, struct event *ev, struct gasmix lastgasmix);
struct event *getEvent();
void eventVisibilityChanged(const QString &eventName, bool visible);
void setVerticalAxis(DiveCartesianAxis *axis, int speed);