mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics: show selected dives in scatter plot
As a visual feedback, show the selected dives in the scatter plot. React to application-wide selection changes. Currently, the dive list is deactivated while in statistics mode, but that may change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
5c098eea29
commit
d85b321784
9 changed files with 68 additions and 8 deletions
|
@ -46,6 +46,7 @@ StatsView::StatsView(QQuickItem *parent) : QQuickItem(parent),
|
|||
connect(&diveListNotifier, &DiveListNotifier::divesDeleted, this, &StatsView::replotIfVisible);
|
||||
connect(&diveListNotifier, &DiveListNotifier::dataReset, this, &StatsView::replotIfVisible);
|
||||
connect(&diveListNotifier, &DiveListNotifier::settingsChanged, this, &StatsView::replotIfVisible);
|
||||
connect(&diveListNotifier, &DiveListNotifier::divesSelected, this, &StatsView::divesSelected);
|
||||
|
||||
setAcceptHoverEvents(true);
|
||||
setAcceptedMouseButtons(Qt::LeftButton);
|
||||
|
@ -345,6 +346,15 @@ void StatsView::replotIfVisible()
|
|||
plot(state);
|
||||
}
|
||||
|
||||
void StatsView::divesSelected(const QVector<dive *> &dives)
|
||||
{
|
||||
if (isVisible()) {
|
||||
for (auto &series: series)
|
||||
series->divesSelected(dives);
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void StatsView::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
if (!draggedItem)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue