Don't create filter 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.
Instead, first check the parent's type and only create the node if that
matches.

Pick-to: 6.10
Change-Id: I3517ea7be578c7c5bd964341dddb7ff9e47ba00a
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
commit2ac47bde220a62327f18b3dddd2b8b24a5afa541
parent80a8a108ffaeb1dbeedaca693274a222ba04aa1c
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeWed, 8 Oct 2025 15:49:45 +0000