diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-12-29 23:04:12 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-10 15:57:39 -0800 |
commit | 0104b0a91588cff613b74d36bff66ac54f5cd1a3 (patch) | |
tree | a1b3f731b896ebd907dd8612d1725a22aa08441d /profile-widget/profilewidget2.cpp | |
parent | dd0939b6f5c9c7399183f2a36b2be77521886ef0 (diff) | |
download | subsurface-0104b0a91588cff613b74d36bff66ac54f5cd1a3.tar.gz |
profile: explicitly update profile items
Instead of listening to the dive-data-model changed and
axis changed signals, update the profile items explicitly
once per plot() call. This avoids double replotting of the
dive items.
The old code had at least two replots per plot() call:
one after profileYAxis()->setMaximum() and one after
dataModel->emitDataChanged().
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 737fdf306..f5d4fd889 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -735,7 +735,11 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict tankItem->setData(&plotInfo, &displayed_dive); gasYAxis->update(); - dataModel->emitDataChanged(); + + // Replot dive items + for (AbstractProfilePolygonItem *item: profileItems) + item->replot(); + // The event items are a bit special since we don't know how many events are going to // exist on a dive, so I cant create cache items for that. that's why they are here // while all other items are up there on the constructor. |