问题
I build a GUI with 100+ widgets, layouts, frames, ... Each one of those I set a name manually with .setObjectName to make debugging easier. Instead of "LayoutObject has a problem" I get error messages such as "name_of_LayoutObject has a problem" which is very convenient. However it enlarges my code by ~20% and makes it less readable. I'd like to set objects names for every kind of PyQt5 Object in one function. For doing so, I'd need to know how to iterate over all those objects.
来源:https://stackoverflow.com/questions/59033316/pyqt5-setobjectname-to-all-objects-widgets