From 999a11a745354a98ae9fbf533d511cf2d9db828a Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jan 2015 14:49:37 +0100 Subject: [PATCH] TreeModel: Fix model back pointer propagation when adding items Only the top level entry was handled so far, but we might add items with subitems. Change-Id: I55084a1f595f4982bd37168e71b144b17eee63b1 Reviewed-by: hjk --- src/libs/utils/treemodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/treemodel.cpp b/src/libs/utils/treemodel.cpp index 6d80bd9e388..a2b585b7988 100644 --- a/src/libs/utils/treemodel.cpp +++ b/src/libs/utils/treemodel.cpp @@ -695,7 +695,7 @@ void TreeItem::insertChild(int pos, TreeItem *item) QModelIndex idx = index(); m_model->beginInsertRows(idx, pos, pos); item->m_parent = this; - item->m_model = m_model; + item->propagateModel(m_model); m_children.insert(m_children.begin() + pos, item); m_model->endInsertRows(); } else {