title: In PyQt5, if you have multiple checkboxes how to direct to function if not a specific one but any is checked?
body: <p>I have a program I'm developing using PyQt5 where I have 6 QComboBoxes to make selections from, and then based on these selections you can narrow down the data further. For clarity, it looks like this: </p>
  
  <p><a href="https://i.stack.imgur.com/CCU6s.png" rel="nofollow noreferrer">Image of Program</a></p>
  
  <p>If something is in the "weakness" category I want the user to have the option to remove it from the final selection process in case the initial results are too narrow. </p>
  
  <p>Here's where the problem is: </p>
  
  <p>The final calculation is based on what checkboxes are checked. To make sure this is as reflected in the GUI I do the following things whenever a combobox is changed: </p>
  
  <ol>
  <li>Changed the QStackedWidgets to the "deactivated" label</li>
  <li>Determine strengths and weaknesses based on type data from comboboxes</li>
  <li>Unchecked all the checkboxes and mark the appropriate ones as checked.</li>
  </ol>
  
  <p>Code for this is below:</p>
  
  <pre><code>        #deactivate all stacks
      for t in range(0,18):
          str_type0 = self.value[t].lower()[0:3]
          str_stack0 = 'self.str_'+str(str_type0)
          eval(str_stack0).setCurrentIndex(0)
  
          weak_type0 = self.value[t].lower()[0:3]
          weak_stack0 = 'self.weak_'+str(weak_type0)
          eval(weak_stack0).setCurrentIndex(0)
  
  
      #strong loop
      for t in range(0,len(self.r)):
          str_type = self.value[self.r[t]].lower()[0:3]
          str_stack = 'self.str_'+str(str_type)
          eval(str_stack).setCurrentIndex(1)
  
      #weak loop
      for t in range(0,len(self.q)):
          weak_type = self.value[self.q[t]].lower()[0:3]
          weak_stack = 'self.weak_'+str(weak_type)
          eval(weak_stack).setCurrentIndex(1)
  
      #set all checkboxes as checked if currently shown in stack
      for t in range(0,18):
          checkstr0= self.value[t].lower()[0:3]
          checkstr1='self.weak_'+str(checkstr0)+'_act'
          eval(checkstr1).setChecked(False)
  
          weak_stack1 = 'self.weak_'+str(checkstr0)
          weak_stack1 = eval(weak_stack1)
          if weak_stack1.currentIndex() == 1:
              eval(checkstr1).setChecked(True)
          else: continue
  </code></pre>
  
  <p>This is fine and works even if it's a little clunky (goal is tomake it work and then make it work efficiently later). The issue is that changing a checkbox is what triggers the function that does all the calculating for the results, but since multiple checkboxes change at the same time, or even just changing one, triggers this function a multiplicity of times. It's a huge waste of computation. </p>
  
  <p>I've thought of some solutions. I think perhaps the best way to solve this problem is to run the function not when any particular checkbox changes but there is a change. Something like: 
  if any (checkbox.checkState()==changed): do something. 
  I'm not sure if that would be a good solution, or how to even do that. </p>
  
  <p>Any ideas are appreciated. Thanks in advance!</p>