Apply and revert styles iteratively


I chose to not change the funtions' names because the effect is still
that the style are changed recursively, only the implementation uses an
iterative algorithm.

Picking back to 6.8 which is the oldest active branch having these
functions.

Pick-to: 6.12 6.11 6.10 6.8
Task-number: QTBUG-145916
Change-Id: I943613d3d70fd05d200d4e226238e3d465fc8e3b
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
commit739f69a8052c8b0a56d67178eac12d9327355da5
parent57622223223f9bbc8a12c4c39507b224114e2a48
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeWed, 1 Jul 2026 07:34:59 +0000