获取 QPushButton 的名称 [英] Get name of QPushButton
本文介绍了获取 QPushButton 的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法得到QPushButton
的名字?
Is there any way to get the name of a QPushButton
?
即
self.pushButton_9_3.setObjectName("pushButton_9_3")
推荐答案
好吧,如果你有按钮的引用,你可以简单地使用
Well, if you have a reference to the button you can simply use
my_button.objectName()
或者你的情况
self.pushButton_9_3.objectName()
这篇关于获取 QPushButton 的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文