TreeModel: Don't validate nested rows recursively


QQmlTreeModel::validateNewRow() called itself for each child row,
recursing once per level of the nested rows. Row data nested deeply
enough exhausted the native stack while being validated.

Validate the rows iteratively instead, keeping the rows still to be
validated on an explicit stack. Children are still validated before
their parent, so the first invalid row reported stays the same.

Reduce the depth of the nested rows used by the tests from 1000 to
100 levels. Rows set from JavaScript are converted by
QJSValue::toVariant() first, which stops at the engine's stack
limit. On QNX, that limit was reached at about 370 levels.

Pick-to: 6.12
Task-number: QTBUG-151007
Change-Id: I4079531f42c342f28e8531f06275a2c9643377b7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
commitbfb36dd30616bb6d3b9f8d594ba495ed3f7e1e38
parent2c3a3340d416f1e7528785e1975fb3a1e018ed5c
authorMate Barany <mate.barany@qt.io>
committerMate Barany <mate.barany@qt.io>
commit timeWed, 21 Oct 2026 18:15:15 +0000