From 80af8e7fa2946bd5b869689d626e9c6ebb4fefaf Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 9 Jan 2015 12:17:02 -0800 Subject: [PATCH] Dive d/l selection UI: update checkmark state correctly This fixes the issue where there was no visual feedback when clicking on the second or third column in the grid. It would actually change the checked state of the checkmark internally (and you would see the new state once you clicked on another dive), but it wouldn't give immediate visual feedback. Signed-off-by: Dirk Hohndel --- qt-ui/downloadfromdivecomputer.cpp | 6 +++--- qt-ui/downloadfromdivecomputer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index e78270ab0..c0c8e8b1c 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -602,10 +602,10 @@ bool DiveImportedModel::setData(const QModelIndex &index, const QVariant &value, return true; } -void DiveImportedModel::changeSelected(QModelIndex index) +void DiveImportedModel::changeSelected(QModelIndex clickedIndex) { - checkStates[index.row()] = !checkStates[index.row()]; - dataChanged(index, index, QVector() << Qt::CheckStateRole); + checkStates[clickedIndex.row()] = !checkStates[clickedIndex.row()]; + dataChanged(index(0, clickedIndex.row()), index(0, clickedIndex.row()), QVector() << Qt::CheckStateRole); } void DiveImportedModel::selectAll() diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h index c010fa0fd..efec64f80 100644 --- a/qt-ui/downloadfromdivecomputer.h +++ b/qt-ui/downloadfromdivecomputer.h @@ -41,7 +41,7 @@ public: public slots: - void changeSelected(QModelIndex index); + void changeSelected(QModelIndex clickedIndex); void selectAll(); void selectNone();