Fix cycle detection in <use> elements


In 0332df304f013ded362537c1f61556098b875352, the cycle
detection was moved to an earlier point in parsing, which
broke cycle detection for the <use> element, since the links
in <use> are not resolved until the end of parsing,
when resolveNodes() is called.

This adds an additional cycle check at the end of parsing
as well.

Pick-to: 6.8 6.9
Change-Id: I13278aa187020df70673f388d76ab609c1ec168b
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
commit6e27565a3bfb0fc56005f6d7c8cf970b1dd0007f
parentb327776a0c7f3160332265256ed561b1d958bfaf
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
commit timeWed, 22 Jan 2025 08:52:54 +0100