Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-909

REG->5.11.2: lambda does not pass argument

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.12.0
    • PySide
    • None
    • CentOS

    Description

      Hello,
      when using a lambda as a slot, the argument value is not passed properly. This is a regression.
      Here is an example:

      from PySide2 import QtCore, QtGui, QtWidgets
      import sys
      
      def foo (text):
          print(text)
      
      if __name__ == '__main__':
          app = QtWidgets.QApplication(sys.argv)
          t = 'data'
          button = QtWidgets.QPushButton('test')
          button.clicked.connect(lambda text=t: foo(text))
          button.show()
          sys.exit(app.exec_())
      

      On PySide2-5.9.1, the output, as expected, was 'data'
      On PySide2-5.12.1, the output is 'False'

      Regards,

      Attachments

        1. lambda.py
          0.5 kB
        2. pyside909_diag.diff
          2 kB
        3. pyside909.py
          0.4 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              afa afa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes