In Qt Designer, put all your buttons inside a container widget.
You can then use findChildren to iterate over all the child buttons. So if self.buttonBox
was your container widget, then you could do something like:
self.buttonGroup = QtGui.QButtonGroup(self)
for button in self.buttonBox.findChildren(QtGui.QAbstractButton):
self.buttonGroup.addButton(button)