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

Add single-shot connection type

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: Some future release
    • Fix Version/s: 6.0
    • Component/s: Core: Object Model
    • Labels:
      None
    • Commits:
      11b8c46d2acf5421a8c57c02a55c3a36a11cf4f2

      Description

      Sometimes, it is useful to have a slot just be triggered once when a signal fires, and then stop listening. There are of course several ways to do that, but they all require a bit of code to keep track of the connection manually or even a second connection to trigger the disconnect of the first.

      It would be convenient to have a special connection type for this: Qt::singleShotConnection. The idea would be that specifying this as the connection type, the connection would be automatically broken after the first time it was triggered.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              peppe Giuseppe D'Angelo
              Reporter:
              andre André Somers
              Votes:
              15 Vote for this issue
              Watchers:
              22 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes