Don't create group nodes which will be deleted anyway
The old code first created the nodes, then checked whether their parent
element has the right type and deleted them if not. This was wasted
effort and could also lead to dangling pointers.
Instead, first check the parent's type and only create the node if that
matches.
Task-number: QTBUG-139961
Pick-to: 6.10.0 6.10 6.9 6.8
Change-Id: Ifa870efbd5f336b34b81aa09b6fe79fb7fc826b9
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
| commit | 7e8898903265d931df0aa54b3913f2c49d4d7bf2 |
| parent | c4de20d0be6c25137d975e11203c2252935b876f |
| author | Robert Löhning <robert.loehning@qt.io> |
| committer | Robert Löhning <robert.loehning@qt.io> |
| commit time | Tue, 16 Sep 2025 13:00:48 +0000 |