Skip to content
Advertisement

Tag: signals-slots

Connecting slots and signals in PyQt4 in a loop

Im trying to build a calculator with PyQt4 and connecting the ‘clicked()’ signals from the buttons doesn’t work as expected. Im creating my buttons for the numbers inside a for loop where i try to connect them afterwards. When I click on the buttons all of them print out ‘9’. Why is that so and how can i fix this?

Advertisement