This does not take into account the fact that the groups are inherited from the parent form by default (which simply cannot be done at build time as the parent is not yet available)