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:
@@ -195,15 +195,17 @@ QVariant ModulesModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
void ModulesModel::setModules(const Modules &m)
|
||||
{
|
||||
beginResetModel();
|
||||
m_modules = m;
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void ModulesModel::clearModel()
|
||||
{
|
||||
if (!m_modules.isEmpty()) {
|
||||
beginResetModel();
|
||||
m_modules.clear();
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user