mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:33:24 +00:00
Bugfix for checkboxes in DC download window GUI repaint delay.
Bug was due to incorrect use of QAbstractItemModel::index. The arguments should be in (row, col) sequence but we were mistakenly passing in (col, row). Fixes #820 Signed-off-by: K. Heller <pestophagous@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4b3a117401
commit
4f287b6f80
1 changed files with 3 additions and 3 deletions
|
@ -682,19 +682,19 @@ QVariant DiveImportedModel::data(const QModelIndex &index, int role) const
|
|||
void DiveImportedModel::changeSelected(QModelIndex clickedIndex)
|
||||
{
|
||||
checkStates[clickedIndex.row()] = !checkStates[clickedIndex.row()];
|
||||
dataChanged(index(0, clickedIndex.row()), index(0, clickedIndex.row()), QVector<int>() << Qt::CheckStateRole);
|
||||
dataChanged(index(clickedIndex.row(), 0), index(clickedIndex.row(), 0), QVector<int>() << Qt::CheckStateRole);
|
||||
}
|
||||
|
||||
void DiveImportedModel::selectAll()
|
||||
{
|
||||
memset(checkStates, true, lastIndex - firstIndex + 1);
|
||||
dataChanged(index(0, 0), index(0, lastIndex - firstIndex), QVector<int>() << Qt::CheckStateRole);
|
||||
dataChanged(index(0, 0), index(lastIndex - firstIndex, 0), QVector<int>() << Qt::CheckStateRole);
|
||||
}
|
||||
|
||||
void DiveImportedModel::selectNone()
|
||||
{
|
||||
memset(checkStates, false, lastIndex - firstIndex + 1);
|
||||
dataChanged(index(0, 0), index(0, lastIndex - firstIndex), QVector<int>() << Qt::CheckStateRole);
|
||||
dataChanged(index(0, 0), index(lastIndex - firstIndex,0 ), QVector<int>() << Qt::CheckStateRole);
|
||||
}
|
||||
|
||||
Qt::ItemFlags DiveImportedModel::flags(const QModelIndex &index) const
|
||||
|
|
Loading…
Add table
Reference in a new issue