So I've got a pyqt5 GUI that generates checkboxes based on the titles of JSON files that are saved in a directory. My next step is making it so that when the users checks a box, it deletes the checkbox, and then the JSON file.
Currently I generate the checkboxes as follows:
for x in self.list:
layout.addWidget(QCheckBox(x),row,0)
row+=1
Since I have not assigned each checkbox to an object, how would I go about checking the state of each box, and then assigning it an action?
Since I'm learning to discuss what I was thinking:
I was hoping I could use Signals to detect when a signal is transmitted from the overall widget, and then slot that with a function that deletes any file in the directory sharing the name of the object that generated the signal.
Is there a better approach to generate the checkboxes as well?