I have a dictionary.
I need to create buttons with keys name, and clicked
slot based on value:
dic = {'a':'111', 'b':'222', 'c':'333'}
for key in dic:
btn = QPushButton(key, self)
btn.clicked.connect(lambda: doit(dic[key]))
vbox.addWidget(btn)
I have all buttons with right name. And last created button behave rightly.
But all others buttons' clicked
slots are also connected to the last created button do('333')
.
How can I make all buttons behave differently?