profile: pass axes and model to DiveEventItem on construction

Firstly, there is no point in supporting DiveEventItems without
model and axis. Secondly, this avoid pointless position-
recalculations.

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

View file

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