title: How can I click multiple buttons by dragging in QtGui?
body: <p>I have a program that creates a grid of buttons using PyQt (all QPushButtons in a QGridLayout), like this:
  <a href="https://i.stack.imgur.com/o0vOj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o0vOj.png" alt="grid"></a></p>
  
  <p>I was wondering how I can drag my mouse while holding mouse1 down to run each button's function for each one that the mouse is dragged over. Right now, when dragging and holding, only the button the click was started on is triggered, and no other buttons can be selected until mouse release. Is there a function that just runs it on press or release, or unselects the button after the function is ran?</p>
  
  <p>For reference, my code for the currently selected button is as follows:</p>
  
  <pre><code>self.button.pressed.connect(lambda: self.click_func(self_global, x, y,
                                                      btn_id))
  </code></pre>
  
  <p>The function isn't important, and would just take up more room here, but I hope you get the point.</p>