Description
pyside2-uic generates this code:
class Ui_FormBase(object): def setupUi(self, FormBase): FormBase.setObjectName("FormBase") FormBase.resize(794, 653) ... QtCore.QMetaObject.connectSlotsByName(FormBase)
but in python is "easy" to add widgets and methods at runtime to classes using metaclasses. In this scenario the call to QtCore.QMetaObject.connectSlotsByName is done too early. It's FormBase that should call connectSlotsByName on itself when the form is "complete", if needed.
In fact calling connectSlotsByName on the same widget multiple times duplicates connections and this leads to multiple slots calls. This could be also a bug by itself: since names are unique in a class I expect unique connections from connectSlotsByName or, at least, a way to tell connectSlotsByName to use Qt::UniqueConnection
A retro-compatible solution could be adding a command line option to pyside2-uic that disables the call to QtCore.QMetaObject.connectSlotsByName in setupUi.