| 167 | } |
| 168 | |
| 169 | void TreeModel::expanded(const QModelIndex &index) |
| 170 | { |
| 171 | TreeItem* item = itemForIndex(index); |
| 172 | QObject::connect(item, &TreeItem::allChildrenFetched, this, &TreeModel::itemChildrenReady); |
| 173 | if (item->hasMore() && item->childCount() == 1) |
| 174 | item->fetchMoreChildren(); |
| 175 | else |
| 176 | emit itemChildrenReady(); |
| 177 | item->setExpanded(true); |
| 178 | } |
| 179 | |
| 180 | void TreeModel::collapsed(const QModelIndex &index) |
| 181 | { |