Skip to content
Snippets Groups Projects
Commit 999a11a7 authored by hjk's avatar hjk
Browse files

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: default avatarhjk <hjk@theqtcompany.com>
parent 706c826b
No related merge requests found
...@@ -695,7 +695,7 @@ void TreeItem::insertChild(int pos, TreeItem *item) ...@@ -695,7 +695,7 @@ void TreeItem::insertChild(int pos, TreeItem *item)
QModelIndex idx = index(); QModelIndex idx = index();
m_model->beginInsertRows(idx, pos, pos); m_model->beginInsertRows(idx, pos, pos);
item->m_parent = this; item->m_parent = this;
item->m_model = m_model; item->propagateModel(m_model);
m_children.insert(m_children.begin() + pos, item); m_children.insert(m_children.begin() + pos, item);
m_model->endInsertRows(); m_model->endInsertRows();
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment