You create x times a Lineedit in the "i" loop but just overwrite the variable c which holds that instance on the next loop iteration thus throwing away the previous instance.
Instead put the line to create a lineedit just before the first time you actually use it. That would be before cells_array[n][a].append(c)
Why the conditional for setting a=0
? Though it might work this looks dangerous and unnecessary to me. If I understand that correctly then you can just set unconditionally a=0 (without a==x) at that place.
Assign the name directly to c.name (or cells_array[n][a]) before add_child(...
. It probably also works your way but you avoid that implicitly a preliminary name has to be assigned just to be overwritten anyway in the next line.