pythonpyqt

How to make a list of checked checkboxes in pyQt


I have more than 10 checkboxes.

I need to make a list of checked checkboxes by user, as each checked box has its own function that depends on the number of checked checkboxes!.


Solution

  • Thanks for your time. I solve it in an easy way, I make a list

    List = [(self.chckbox_name.isChecked() , "#name or string I need to be returned if condition is true") , ...etc ]
    
    List_of_checked =[] 
    
    List_of_unchecked = []
    
    for i, v in List: 
          if i == True:
                  List_of_checked.append (v)
          else:
                  List_of_unchecked.append (v)