I am trying to make a simple app with PySide. I have a grid layout with some cells being QLineEdit
widgets. I want to clear the text fields of the 4 of these by a button click. Here is a part of my code:
editFields = [angle1Edit, angle2Edit, len1Edit, len2Edit]
clearBtn.clicked.connect(self.clearAll(editFields))
def clearAll(self, fields):
for field in fields:
return field.clear
In the editFields
I collected the 4 widgets which I want to clean. But this only clears the first one but not all of them.
How can I do it for all? Is there another possibility to perform such action? Maybe I can use other widget for this task? Thank you.