Utils: Introduce TreeItem::{begin,end}

... and use this to reduce the number of explicit uses of m_children.

Despite of being shorter code by itself it is a step towards having
an explicit LeafItem object that doesn't explicitly store a(n empty)
vector of child nodes.

Change-Id: If8db85e2f1134dd1578a78d31235bf57a28f863a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2017-02-07 08:53:00 +01:00
parent af54ab960a
commit 196dbbe0e7
16 changed files with 75 additions and 66 deletions

View File

@@ -221,7 +221,7 @@ ToolTipWatchItem::ToolTipWatchItem(TreeItem *item)
valueColor = model->data(idx.sibling(idx.row(), 1), Qt::ForegroundRole).value<QColor>();
expandable = model->hasChildren(idx);
expression = model->data(idx.sibling(idx.row(), 0), Qt::EditRole).toString();
foreach (TreeItem *child, item->children())
for (TreeItem *child : *item)
appendChild(new ToolTipWatchItem(child));
}