mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Update Qt4 patch
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6a2efd9ff6
commit
762315e7ee
6 changed files with 137 additions and 14 deletions
|
@ -602,19 +602,31 @@ QVariant DiveImportedModel::data(const QModelIndex &index, int role) const
|
|||
void DiveImportedModel::changeSelected(QModelIndex clickedIndex)
|
||||
{
|
||||
checkStates[clickedIndex.row()] = !checkStates[clickedIndex.row()];
|
||||
#if QT_VERSION >= 0x050000
|
||||
dataChanged(index(0, clickedIndex.row()), index(0, clickedIndex.row()), QVector<int>() << Qt::CheckStateRole);
|
||||
#else
|
||||
dataChanged(index(0, clickedIndex.row()), index(0, clickedIndex.row()));
|
||||
#endif
|
||||
}
|
||||
|
||||
void DiveImportedModel::selectAll()
|
||||
{
|
||||
memset(checkStates, true, lastIndex - firstIndex + 1);
|
||||
#if QT_VERSION >= 0x050000
|
||||
dataChanged(index(0, 0), index(0, lastIndex - firstIndex), QVector<int>() << Qt::CheckStateRole);
|
||||
#else
|
||||
dataChanged(index(0, 0), index(0, lastIndex - firstIndex));
|
||||
#endif
|
||||
}
|
||||
|
||||
void DiveImportedModel::selectNone()
|
||||
{
|
||||
memset(checkStates, false, lastIndex - firstIndex + 1);
|
||||
#if QT_VERSION >= 0x050000
|
||||
dataChanged(index(0, 0), index(0, lastIndex - firstIndex), QVector<int>() << Qt::CheckStateRole);
|
||||
#else
|
||||
dataChanged(index(0, 0), index(0, lastIndex - firstIndex ));
|
||||
#endif
|
||||
}
|
||||
|
||||
Qt::ItemFlags DiveImportedModel::flags(const QModelIndex &index) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue