From 218fff76d51e29f7808ce670a7c61ef9c429046f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 1 Aug 2012 16:33:03 +0200 Subject: [PATCH] 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 --- examples/player/playlistmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/player/playlistmodel.cpp b/examples/player/playlistmodel.cpp index da3f09c..50a6634 100644 --- a/examples/player/playlistmodel.cpp +++ b/examples/player/playlistmodel.cpp @@ -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) -- 2.7.4