QQmlTreeRow: Don't export the tree recursively


QQmlTreeRow::toVariant(), used by TreeModel's rows property and
getRow(), called toVariant() on each child, recursing once per level of
the tree. A tree nested deeply enough therefore exhausted the native
stack when its rows were read back.

Export the tree iteratively instead, in post-order, keeping the rows
still to be completed on an explicit stack.

Pick-to: 6.12
Task-number: QTBUG-151007
Change-Id: Ibb4e5f4c1baa0c0f5d9aa3b2aece2aa32f7a108f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
commit668c8d6b8d44f84b8fbd816cea458b72fb496661
parentbf9495f096a7fbf85f9a1cf26c550f8f7aaece2c
authorMate Barany <mate.barany@qt.io>
committerMate Barany <mate.barany@qt.io>
commit timeWed, 14 Oct 2026 10:06:13 +0000