[kirigami] make it compile without foreach
Summary: compile without foreach
Test Plan: autotest ok
Reviewers: dfaure, mart
Reviewed By: mart
Subscribers: apol, plasma-devel
Tags: Kirigami
Differential Revision: https://phabricator.kde.org/D19851