def spawnReps(self):
db = SECLIB.connectToDB()
cursor = db.cursor()
cursor.execute("Select * from Reps")
for x in cursor:
thisWidget = QtWidgets.QWidget()
thisLayout = QtWidgets.QHBoxLayout(thisWidget)
thisRepNumLabel = QtWidgets.QLabel(text="Rep Num:")
thisRepNum = QtWidgets.QLineEdit()
thisRepNum.setText(x[0])
thisLayout.addWidget(thisRepNumLabel)
thisLayout.addWidget(thisRepNum)
thisRepFnameLabel = QtWidgets.QLabel(text="First Name:")
thisRepFname = QtWidgets.QLineEdit()
thisRepFname.setText(x[1])
thisRepFname.editingFinished.connect(lambda: self.repUpdated(thisRepFname.text()))
def repUpdated(self, object):
print(object)
So this function generates a sheet to view all of our agents, I want to make each of them directly editable in line, but when I connect the function in the for loop every edit returns the very last instance that was created. What would i need to do for it to return the Instance that was actually changed??