Commit 5fb54e7c authored by Tobias Hunger's avatar Tobias Hunger

TreeModel: Send modelReset() in setRootItem(...)

Change-Id: Ie24b1888521fe601455a5a15a01f02fb8b30e536
Reviewed-by: default avatarhjk <hjk@qt.io>
parent cd51ff7c
......@@ -1065,9 +1065,10 @@ void BaseTreeModel::setRootItem(TreeItem *item)
QTC_ASSERT(item, return);
QTC_ASSERT(item->m_model == 0, return);
QTC_ASSERT(item->m_parent == 0, return);
QTC_ASSERT(item != m_root, return);
QTC_CHECK(m_root);
emit layoutAboutToBeChanged();
beginResetModel();
if (m_root) {
QTC_CHECK(m_root->m_parent == 0);
QTC_CHECK(m_root->m_model == this);
......@@ -1079,7 +1080,7 @@ void BaseTreeModel::setRootItem(TreeItem *item)
}
m_root = item;
item->propagateModel(this);
emit layoutChanged();
endResetModel();
}
void BaseTreeModel::setHeader(const QStringList &displays)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment