Skip to content
Snippets Groups Projects
Commit ac263ef2 authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlOutline: Speed up updates

Guard the incremental updates with beginResetModel/endResetModel

This gives better overall performance then passing the incremental
updates to the views.

Tested-by: Lasse Holmstedt
parent 3cd32eff
No related branches found
No related tags found
No related merge requests found
......@@ -367,6 +367,10 @@ void QmlOutlineModel::update(const SemanticInfo &semanticInfo)
m_treePos.append(0);
m_currentItem = invisibleRootItem();
// resetModel() actually gives better average performance
// then the incremental updates.
beginResetModel();
m_typeToIcon.clear();
m_itemToNode.clear();
m_itemToIdNode.clear();
......@@ -376,6 +380,8 @@ void QmlOutlineModel::update(const SemanticInfo &semanticInfo)
QmlOutlineModelSync syncModel(this);
syncModel(m_semanticInfo.document);
endResetModel();
emit updated();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment