mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: select / unselect dive by clicking on it
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1de1a85e32
commit
52e07a6306
3 changed files with 27 additions and 2 deletions
|
@ -101,6 +101,12 @@ void DiveImportedModel::selectAll()
|
|||
dataChanged(index(0, 0), index(lastIndex - firstIndex, 0), QVector<int>() << Qt::CheckStateRole);
|
||||
}
|
||||
|
||||
void DiveImportedModel::selectRow(int row)
|
||||
{
|
||||
checkStates[row] = !checkStates[row];
|
||||
dataChanged(index(row, 0), index(row, 0));
|
||||
}
|
||||
|
||||
void DiveImportedModel::selectNone()
|
||||
{
|
||||
memset(checkStates, false, lastIndex - firstIndex + 1);
|
||||
|
@ -169,6 +175,7 @@ QHash<int, QByteArray> DiveImportedModel::roleNames() const {
|
|||
static QHash<int, QByteArray> roles = {
|
||||
{ DateTime, "datetime"},
|
||||
{ Depth, "depth"},
|
||||
{ Duration, "duration"}};
|
||||
{ Duration, "duration"},
|
||||
};
|
||||
return roles;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue