如果我想一次添加10个QPushButton:
NumCount=20
for i in range(NumCount):
btn=QPushButton("%s %s" %("Button" i+1),self)
btn.clicked.connect(self.btnclick)
def btnclick(self):
# here is my question
# how to define which button clicked?
# how to print btn.text?
Run Code Online (Sandbox Code Playgroud)
如def(btnclick)中所述.