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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-01-09 12:17:02 -08:00
parent 15fb6158bc
commit 80af8e7fa2
2 changed files with 4 additions and 4 deletions

View file

@ -602,10 +602,10 @@ bool DiveImportedModel::setData(const QModelIndex &index, const QVariant &value,
return true; return true;
} }
void DiveImportedModel::changeSelected(QModelIndex index) void DiveImportedModel::changeSelected(QModelIndex clickedIndex)
{ {
checkStates[index.row()] = !checkStates[index.row()]; checkStates[clickedIndex.row()] = !checkStates[clickedIndex.row()];
dataChanged(index, index, QVector<int>() << Qt::CheckStateRole); dataChanged(index(0, clickedIndex.row()), index(0, clickedIndex.row()), QVector<int>() << Qt::CheckStateRole);
} }
void DiveImportedModel::selectAll() void DiveImportedModel::selectAll()

View file

@ -41,7 +41,7 @@ public:
public public
slots: slots:
void changeSelected(QModelIndex index); void changeSelected(QModelIndex clickedIndex);
void selectAll(); void selectAll();
void selectNone(); void selectNone();