From 3c6cdfd8c02e215f98986cbb74b33f58e47fe632 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 14 Aug 2018 09:12:21 -0400 Subject: Dive list: propagate current-item to frontend The command-objects select a current item, but this selection was not propagated to the front-end. The current item is the base for keyboard-navigation through the dive-list and therefore should be set correctly. It took some experimentation to get the flags right: QItemSelectionModel::Current Hopefully, these are the correct flags across all supported Qt versions! Signed-off-by: Berthold Stoeger --- qt-models/divetripmodel.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-models/divetripmodel.h') diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h index 5cd69852c..c8050a6da 100644 --- a/qt-models/divetripmodel.h +++ b/qt-models/divetripmodel.h @@ -118,6 +118,7 @@ signals: // indexes into local indexes according to current sorting/filtering and instructs the QSelectionModel to // perform the appropriate actions. void selectionChanged(const QVector &indexes, bool select); + void newCurrentDive(QModelIndex index); private slots: void divesAdded(dive_trip *trip, bool addTrip, const QVector &dives); void divesDeleted(dive_trip *trip, bool deleteTrip, const QVector &dives); @@ -126,6 +127,7 @@ private slots: void divesMovedBetweenTrips(dive_trip *from, dive_trip *to, bool deleteFrom, bool createTo, const QVector &dives); void divesSelected(dive_trip *trip, const QVector &dives); void divesDeselected(dive_trip *trip, const QVector &dives); + void currentDiveChanged(); private: // The model has up to two levels. At the top level, we have either trips or dives // that do not belong to trips. Such a top-level item is represented by the "Item" -- cgit v1.2.3-70-g09d2