I'm currently trying out PyQt. A part of my application should contain input fields (QLineEdits). In this fields a user can enter a value and a label gives him a feedback if the input is a number. I create the QLineEdit and the corresponding labels in a for-loop with the following code:
for i in range(4):
edit = QLineEdit()
msgLabel = QLabel("")
layout.addWidget(edit,i,0)
layout.addWidget(msgLabel,i,1)
edit.textChanged[str].connect(checkIfNumber(msgLabel,edit.text()))
My problem is that only the last element is concidered. Each element has the connect but only the text of the 4th element and the 4th label are used. How can I fix this problem? Thank you!