I have a Grid of PyQt5 Frames and want to make every frame clickable to call a function and pass a variable.
I know that you can make it clickable and call function like this:
self.frame[0][0].mousePressEvent = self.test
but I can't pass a variable.
Is there a way to attach a specific x and y coordinate to the frames? I tried it like this but it only passes the final value of x and y:
for y in range(50): for x in range(50): self.pixel[x][y].mousePressEvent = lambda _: self.test(x, y)