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

Passing references to slots in another thread - undocumented important behaviour

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.9.5, 5.10.1
    • None

    Description

      Qt's signals and slots mechanism allows sending signals with parameters to slots in other threads (with QueuedConnection for example).

      There appears to be no official documentation to explain how sending a reference parameter over this sort of signal is thread safe. (it is, allegedly, but there are no official docs for it).

      According to this https://stackoverflow.com/questions/8455887/stack-object-qt-signal-and-parameter-as-reference/18146433 there is a mechanism that creates copies of the objects for queued connections.

      This is an important detail that should be documented otherwise users will end up jumping through hoops to protect themselves against concurrent access which is not happening.

      Attachments

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

        Activity

          People

            docteam Qt Documentation Team
            Dynite Michael Cox
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes