Fix stack overflow in detectCycles


The function calls itself recursively to detect cycles in a parsed
SVG file. This can cause a stack overflow in a deeply nested files.

Pick-to: 6.12 6.11 6.10 6.8
Fixes: QTBUG-145916
Change-Id: I63a1c945caf5de1e72cad440d433e30b36103e53
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
commitd8ff98f5ec716a5441fd88bfb8eb1f7709a8cd6e
parenta626f7c1014a73ce825c72cf4168ffc10f016659
authorHatem ElKharashy <hatem.elkharashy@qt.io>
committerHatem ElKharashy <hatem.elkharashy@qt.io>
commit timeWed, 10 Jun 2026 10:18:34 +0000