Return Qt::NoItemFlags instead of nullptr

This commit is contained in:
Luis Ángel San Martín 2021-10-07 22:25:19 +02:00
parent 509b33e991
commit fdd98fc012
3 changed files with 5 additions and 5 deletions

View File

@ -57,7 +57,7 @@ QVariant LocalComicListModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags LocalComicListModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
return nullptr;
return Qt::NoItemFlags;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
@ -144,7 +144,7 @@ void LocalComicListModel::moveSelectionUp(const QList<QModelIndex> &selectedInde
beginMoveRows(mi.parent(), sourceRow, sourceLastRow, mi.parent(), destRow);
for (int i = sourceRow; i <= sourceLastRow; i++)
_data.swap(i, i - 1);
_data.swapItemsAt(i, i - 1);
endMoveRows();
}
@ -163,7 +163,7 @@ void LocalComicListModel::moveSelectionDown(const QList<QModelIndex> &selectedIn
beginMoveRows(mi.parent(), sourceRow, sourceLastRow, mi.parent(), destRow + 1);
for (int i = sourceLastRow; i >= sourceRow; i--)
_data.swap(i, i + 1);
_data.swapItemsAt(i, i + 1);
endMoveRows();
}

View File

@ -105,7 +105,7 @@ QVariant VolumeComicsModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags VolumeComicsModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
return nullptr;
return Qt::NoItemFlags;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}

View File

@ -102,7 +102,7 @@ QVariant VolumesModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags VolumesModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
return nullptr;
return Qt::NoItemFlags;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}