QAbstractItemMode::reset() is deprecated, don't use it
Instead, use beginResetModel() before the model is reset, and add endResetModel() after it. Change-Id: Ibac3f2207ed999ed9d703266509b3ad91203f28d Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
committed by
Qt by Nokia
parent
cfa44b12be
commit
218fff76d5
@@ -106,6 +106,7 @@ void PlaylistModel::setPlaylist(QMediaPlaylist *playlist)
|
||||
disconnect(m_playlist, SIGNAL(mediaChanged(int,int)), this, SLOT(changeItems(int,int)));
|
||||
}
|
||||
|
||||
beginResetModel();
|
||||
m_playlist = playlist;
|
||||
|
||||
if (m_playlist) {
|
||||
@@ -116,8 +117,7 @@ void PlaylistModel::setPlaylist(QMediaPlaylist *playlist)
|
||||
connect(m_playlist, SIGNAL(mediaChanged(int,int)), this, SLOT(changeItems(int,int)));
|
||||
}
|
||||
|
||||
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
bool PlaylistModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
|
||||
Reference in New Issue
Block a user