pyqt5如何通过名字获得对应的控件

self.findChild(QComboBox, "name")

 

 

self.findChild(QComboBox, "name") 

self is class

first parameter is Type

second parameter is Id String

 

 

------

通吃:

self.findChild(QWidget, "name")

 

posted @ 2020-03-04 16:13  bH1pJ  阅读(173)  评论(0编辑  收藏  举报