PyQt5: setObjectName to all Objects/Widgets [duplicate]

岁酱吖の 提交于 2020-01-22 03:04:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!