The visibility of the tree expansion decoration ⊞ is controlled by the number of children the item has. No children, no indicator. You do not create the children until the first time the data() function is called (on any item for any reason, almost certainly not right). If the view calls hasChildren() or rowCount() before it calls data() then you have no children hence no indicator.
Your model is peculiar to say the least. If you want all the 5000 top level items to have default children then simply create them at construction time and return the vector count() for rowCount().
Bookmarks