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>