title: Passing input value to a lambda function to trigger a signal
body: <p>I am creating a number of <code>widgets</code> inside a layout, and every widget is passing a signal (current number rows). But, suerprisingly, the output is not a number (row_count), but <code>False</code>?</p>
  <pre><code>from PyQt5.QtWidgets import *
  from PyQt5.QtGui import *
  from PyQt5.QtCore import *
  import sys
  
  class main(QWidget):
      def __init__(self):
          super().__init__()
          
          top_layout = QFormLayout()
          self.setLayout(top_layout)
          
          test = QToolButton()
          test.setText('W_1')
          top_layout.addRow(test)
          test.clicked.connect(lambda val=top_layout.rowCount(): self.delNewPar(val))
  
          test2 = QToolButton()
          test2.setText('W_2')
          top_layout.addRow(test2)
          test2.clicked.connect(lambda val=top_layout.rowCount(): self.delNewPar(val))
  
          test3 = QToolButton()
          test3.setText('W_3')
          top_layout.addRow(test3)
          test3.clicked.connect(lambda val=top_layout.rowCount(): self.delNewPar(val))
          
      @pyqtSlot(int)
      def delNewPar(self, val):
          print(val)        
     
  if __name__ == &quot;__main__&quot;:
      app = QApplication(sys.argv)
      widget = main()
      widget.show()
      sys.exit(app.exec_())      
  </code></pre>
  <p>The output when click different buttons is:</p>
  <pre><code>False
  False
  False
  False
  False
  False
  </code></pre>
  <p>What am I missing in this procedure ?</p>
  <p>This is a working example (same logic I am following:)</p>
  <pre><code>from PyQt5.QtWidgets import (
      QApplication, QMainWindow, QAction, QPushButton,
      QWidget, QLabel, QVBoxLayout, QHBoxLayout
  )
  import sys
  
  class Window(QWidget):
  
      def __init__(self):
          super().__init__()
  
          v = QVBoxLayout()
          h = QHBoxLayout()
  
          for a in range(10):
              button = QPushButton(str(a))
              button.pressed.connect(
                  lambda val=a: self.button_pressed(val)
              )                   # pass the value in as a (re-)named parameter.
              h.addWidget(button)
  
          v.addLayout(h)
          self.label = QLabel(&quot;&quot;)
          v.addWidget(self.label)
          self.setLayout(v)
  
      def button_pressed(self, n):
          self.label.setText(str(n))
  
  
  app = QApplication(sys.argv)
  w = Window()
  w.show()
  app.exec_()
  </code></pre>
  <p>I am using the same logic, but my output is different !?</p>