forked from qt-creator/qt-creator
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 <hjk@theqtcompany.com>
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user