From fdd98fc0126271f013673b1dc3b44d8d971bf889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Thu, 7 Oct 2021 22:25:19 +0200 Subject: [PATCH] Return Qt::NoItemFlags instead of nullptr --- .../comic_vine/model/local_comic_list_model.cpp | 6 +++--- YACReaderLibrary/comic_vine/model/volume_comics_model.cpp | 2 +- YACReaderLibrary/comic_vine/model/volumes_model.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/YACReaderLibrary/comic_vine/model/local_comic_list_model.cpp b/YACReaderLibrary/comic_vine/model/local_comic_list_model.cpp index d6874f90..e2cbc2ba 100644 --- a/YACReaderLibrary/comic_vine/model/local_comic_list_model.cpp +++ b/YACReaderLibrary/comic_vine/model/local_comic_list_model.cpp @@ -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 &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 &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(); } diff --git a/YACReaderLibrary/comic_vine/model/volume_comics_model.cpp b/YACReaderLibrary/comic_vine/model/volume_comics_model.cpp index a67f1211..908d7614 100644 --- a/YACReaderLibrary/comic_vine/model/volume_comics_model.cpp +++ b/YACReaderLibrary/comic_vine/model/volume_comics_model.cpp @@ -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; } diff --git a/YACReaderLibrary/comic_vine/model/volumes_model.cpp b/YACReaderLibrary/comic_vine/model/volumes_model.cpp index ae8de88c..23015354 100644 --- a/YACReaderLibrary/comic_vine/model/volumes_model.cpp +++ b/YACReaderLibrary/comic_vine/model/volumes_model.cpp @@ -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; }