forked from qt-creator/qt-creator
Do not use QAbstractItemModel::reset().
Change-Id: Ie49bdf576a6d3543aef6df133b27c8827775c935
Rationale:
a) It is conceptually cleaner to do the changes to the model
in between calls to beginResetModel() and endResetModel,
respectively.
b) The function is deprecated in Qt 5, for exactly that reason.
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -137,6 +137,8 @@ QVariant CategoryModel::data(const QModelIndex &index, int role) const
|
||||
void CategoryModel::setPages(const QList<IOptionsPage*> &pages,
|
||||
const QList<IOptionsPageProvider *> &providers)
|
||||
{
|
||||
beginResetModel();
|
||||
|
||||
// Clear any previous categories
|
||||
qDeleteAll(m_categories);
|
||||
m_categories.clear();
|
||||
@@ -176,7 +178,7 @@ void CategoryModel::setPages(const QList<IOptionsPage*> &pages,
|
||||
category->providers.append(provider);
|
||||
}
|
||||
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
Category *CategoryModel::findCategoryById(const QString &id)
|
||||
|
||||
Reference in New Issue
Block a user