Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-52542

Lambdas are copied at emission time

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.1
    • 5.4.2
    • Core: Object Model
    • None
    • dbe9a8c9696428529cacb9dd4e004db99914b56e

    Description

      As mentioned in the mailing list:

      If you pass a mutable lambda (or function object) to QObject::connect, each time the signal is emitted, the values captured are the ones passed at the time when connect was called. This is due to the object being copied each time the signal is emitted.

      Attachments

        For Gerrit Dashboard: QTBUG-52542
        # Subject Branch Project Status CR V

        Activity

          People

            ogoffart Olivier Goffart (Woboq GmbH)
            suy Alejandro Exojo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes