Maybe restructure the widgets loop as a `for()` and cppcheck might recognise it better?
Tried but didn't help and would be even worse as you first need to know the array size. #1017 fixes the `cppcheck` warning which actually seems to be a false positive, `cppcheck` gets confused about the pointer dereferencing.