Update Qt4 patch

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-02-19 21:52:41 -08:00
parent 6a2efd9ff6
commit 762315e7ee
6 changed files with 137 additions and 14 deletions

View file

@ -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