pyqt5

Creating PyQt5 buttons in a loop: all buttons trigger the same callback

ぃ、小莉子 提交于 2020-11-27 04:02:42
问题 I should mention that I've read these but I'm still unable to achieve my goal: [Using a dictionary in a for loop to create buttons doesn't work [QtCore.QObject.connect in a loop only affects the last instance My goal is to make a linux 'launcher' application. Button creation, placement, etc. is working like a charm but there's one problem - all buttons trigger the same callback - the last one to be connected in the button creation loop. Here's a basic version of the script to illustrate what