mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics: replot stats if dives added / removed
It is crucial to replot the statistics when dives are added / removed, to avoid stale pointers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b7e62307c5
commit
1797b59c10
2 changed files with 9 additions and 10 deletions
|
|
@ -18,6 +18,7 @@
|
|||
#include "zvalues.h"
|
||||
#include "core/divefilter.h"
|
||||
#include "core/subsurface-qt/divelistnotifier.h"
|
||||
#include "core/trip.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <QQuickItem>
|
||||
|
|
@ -41,6 +42,10 @@ StatsView::StatsView(QQuickItem *parent) : QQuickItem(parent),
|
|||
setFlag(ItemHasContents, true);
|
||||
|
||||
connect(&diveListNotifier, &DiveListNotifier::numShownChanged, this, &StatsView::replotIfVisible);
|
||||
connect(&diveListNotifier, &DiveListNotifier::divesAdded, this, &StatsView::replotIfVisible);
|
||||
connect(&diveListNotifier, &DiveListNotifier::divesDeleted, this, &StatsView::replotIfVisible);
|
||||
connect(&diveListNotifier, &DiveListNotifier::dataReset, this, &StatsView::replotIfVisible);
|
||||
connect(&diveListNotifier, &DiveListNotifier::settingsChanged, this, &StatsView::replotIfVisible);
|
||||
|
||||
setAcceptHoverEvents(true);
|
||||
setAcceptedMouseButtons(Qt::LeftButton);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue