summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelistview.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-11-28 00:14:14 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-28 12:15:24 -0800
commit4928c4ae0421193bbd371cb0924091a970489611 (patch)
treecd4795c6e0273126faa56e3063fea70ff12fe2bc /desktop-widgets/divelistview.h
parent7d77db96e30fc238aee9f229e583429a6883bf34 (diff)
downloadsubsurface-4928c4ae0421193bbd371cb0924091a970489611.tar.gz
Desktop: Improve speed of selecting multiple (or all) dives
When selecting all dives via CTRL-A or manually and the trips were not expanded, the QSelectionModel sends a single selectionChanged signal per trip. We are reloading the map in every call, making this very slow. I couldn't figure out how to make QSelectionModel behave more nicely, therefore I chose the nuclear option: Remove the map reloading from selectionChanged() and hook into all functions that do selection changes. In these functions, first call the original code and then do the selection-changed operations. This will certainly need some tuning. Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/divelistview.h')
-rw-r--r--desktop-widgets/divelistview.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h
index 0d5117ca3..67b1b269b 100644
--- a/desktop-widgets/divelistview.h
+++ b/desktop-widgets/divelistview.h
@@ -70,6 +70,9 @@ slots:
void filterFinished();
void tripChanged(dive_trip *trip, TripField);
private:
+ void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) override;
+ void selectAll() override;
+ void selectionChangeDone();
bool mouseClickSelection;
QList<int> expandedRows;
DiveTripModelBase::Layout currentLayout;