How do I load children from .ui file in PySide?

UPDATE: The original solution below was written for PySide (Qt4). It still works with both PySide2 (Qt5) and PySide6 (Qt6), but with a couple of provisos: The connectSlotsByName feature requires that the corresponding slots are decorated with an appropriate QtCore.Slot. Custom/Promoted widgets aren’t handled automatically. The required classes must be explicily imported and registered with … Read more