diff options
Diffstat (limited to 'tests/auto/xmlpatternssdk/TreeModel.cpp')
-rw-r--r-- | tests/auto/xmlpatternssdk/TreeModel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/xmlpatternssdk/TreeModel.cpp b/tests/auto/xmlpatternssdk/TreeModel.cpp index 43d6934..0fdc441 100644 --- a/tests/auto/xmlpatternssdk/TreeModel.cpp +++ b/tests/auto/xmlpatternssdk/TreeModel.cpp @@ -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; } |