mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
selection: trickle down trip selection
The trip selection code was an awkward layering violation. Whereas dive selections due to dive undo-commands trickled down via DiveTripModel-->MultiFilterSortModel-->DiveListView, for trip editing, the DiveListView directly intercepted the TripEdited signal. Instead, mimic the dive-selection code. This is a bit longer but more consistent and logical. The undo/redo of trip changes is now also a "programmatical" change of the selection. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9ccb940a1b
commit
8581e213ed
11 changed files with 113 additions and 57 deletions
|
@ -52,17 +52,17 @@ slots:
|
|||
void addDivesToTrip();
|
||||
void shiftTimes();
|
||||
void diveSelectionChanged(const QVector<QModelIndex> &indices, QModelIndex currentDive);
|
||||
void tripChanged(dive_trip *trip, TripField);
|
||||
void tripSelected(QModelIndex trip, QModelIndex currentDive);
|
||||
private:
|
||||
void rowsInserted(const QModelIndex &parent, int start, int end) override;
|
||||
void reset() override;
|
||||
void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) override;
|
||||
void unselectDives();
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
void selectAll() override;
|
||||
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;
|
||||
void selectionChangeDone();
|
||||
void selectTripItems(QModelIndex index);
|
||||
DiveTripModelBase::Layout currentLayout;
|
||||
QModelIndex contextMenuIndex;
|
||||
// Remember the initial column widths, to avoid writing unchanged widths to the settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue