Avoid using 'for..in' to iterate over collections
'for..in' construct iterates through enumerable properties meaning that
user added properties to default type's prototype (like Array.prototype.first)
are also included. Proper usage involves 'hasOwnProperty' but is not as
clean and generally discouraged by popular style guides in favor of
'for..of' and 'Object.keys' and higher-order functions like 'forEach'.
Adopt them for iteration to fix unexpected property warnings.
Fixes: QTBUG-50999
Change-Id: Ia0846b0c5a2c34f5ee6f1dcb82198cb3946a95f1
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>