title: conect multiple buttons to same function with different parameters
body: <p>I want to create multiple buttons by a for loop.
  Pressing on the buttons call same function but transfer a different parameters.</p>
  
  <pre><code>def someFunction(self):
        buttons = [None] * 8
        for i in range(8):
              buttons[i] = QPushButton(self)
              buttons[i].clicked.connect(self.function(i))
  
  def function(self, i):
          print(i)
  </code></pre>
  
  <p>I expect the output of buttons[i] to be i but the output always 7</p>