QQmlTreeRow: Don't count the rows of a subtree recursively


QQmlTreeRow::subTreeSize(), used by QQmlTreeModel::treeSize(), called
subTreeSize() on each child, recursing once per level of the tree. A
tree nested deeply enough therefore exhausted the native stack when its
size was computed.

Count the rows iteratively instead, keeping the rows still to be
counted on an explicit stack.

Pick-to: 6.12
Task-number: QTBUG-151007
Change-Id: I38cafb089ec780b00053e52eb18d476b3a87f196
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
commitc7b4986dbf6bee362f25025ca246ae2ff29bec71
parent2675658e931fddea619f931fe661e6fc8f322cda
authorMate Barany <mate.barany@qt.io>
committerMate Barany <mate.barany@qt.io>
commit timeMon, 19 Oct 2026 17:56:56 +0000