profile: explicitly clear profile items

In contrast to most other items, which are cleared in the
setEmptyState() function, the profile items are cleared
indirectly via a signal from the model. Very hard to follow
and indeed, I thought I could just remove the slot.

Do this explicitly instead for deterministic code.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-12-24 19:21:30 +01:00 committed by Dirk Hohndel
parent e61466e178
commit 02fbaffe4c
3 changed files with 10 additions and 9 deletions

View file

@ -37,10 +37,10 @@ class AbstractProfilePolygonItem : public QObject, public QGraphicsPolygonItem {
public:
AbstractProfilePolygonItem(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn);
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) = 0;
void clear();
public
slots:
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
virtual void modelDataRemoved(const QModelIndex &parent, int from, int to);
void replot();
void setVisible(bool visible);