diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-02-08 22:05:37 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-02-08 14:06:18 -0800 |
commit | 2cea115ddb7528d9e6dd1bf918ebf5c670b82479 (patch) | |
tree | 372aec558eb5404d8268ed6f2db7721f8a219a4e /desktop-widgets/divelistview.h | |
parent | 1f03a8be81527c2c32e66a169457340283c0e7ce (diff) | |
download | subsurface-2cea115ddb7528d9e6dd1bf918ebf5c670b82479.tar.gz |
Dive list: be more careful on when updating the UI after selection
Fix two issues:
1) When narrowing the selection, we didn't get setSelection()
calls. Only, when the user released the mouse button was
the selection updated. Therefore, hook into the mouse-release-
event and update the UI if the selection changed.
2) We updated the ui in setSelection(). However, this was called
on mouse-move even if the actual selection didn't change.
Therefore, compare selection before and after processing of
the event and only refresh the UI if there are changes.
Clearly, this can only be a quick stopgap solution and we
should find out how to properly hook into the selection change
machinery. Though see commit 4928c4ae0421193bbd371cb0924091a970489611
for the reason why we do things as we do them.
Fixes #2595
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.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h index ca6c61e9e..20f568479 100644 --- a/desktop-widgets/divelistview.h +++ b/desktop-widgets/divelistview.h @@ -65,6 +65,7 @@ slots: void tripChanged(dive_trip *trip, TripField); private: void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) override; + void mouseReleaseEvent(QMouseEvent *event) override; void selectAll() override; void selectionChangeDone(); DiveTripModelBase::Layout currentLayout; |