Commit aa38299e authored by Thiago Macieira's avatar Thiago Macieira Committed by Qt by Nokia
Browse files

QAbstractItemModel::reset is deprecated.


Remember to properly notify that the model is resetting *before* we
start to reset it.

Change-Id: I88931c60ff5800b53f23a63c3766d7c705845cca
Reviewed-by: default avatarStephen Kelly <stephen.kelly@kdab.com>
parent c1623a0d
Branches
Tags
No related merge requests found
Showing with 6 additions and 1 deletion
......@@ -173,11 +173,16 @@ TreeItem *TreeModel::root() const
void TreeModel::setRoot(TreeItem *r)
{
TreeItem *const oldRoot = m_root;
/* Notify views that we are radically changing. */
beginResetModel();
m_root = r;
if(m_root)
connect(r, SIGNAL(changed(TreeItem *)), SLOT(childChanged(TreeItem *)));
reset(); /* Notify views that we have radically changed. */
endResetModel();
delete oldRoot;
}
......
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