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

"Gradual" disconnects for QObject signals

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Core: Object Model
    • None

    Description

      When going from string-based connect to PMF connect, there is a gotcha - the PMF-based connection stays valid all the way until QObject's destructor. For the string-based connect it inadvertently leaned on virtual calls no longer resolving to the most-derived type as it was being destructed, so the slots could no longer be found.

      What this means is that that a blind port is not possible, since any call during destruction which could lead to a signal emission somewhere might lead back to a partially-destructed derived type's PMF-connected slot.

       

      This task covers looking into ways to work around/fix this.

      As a BC option we may be able to use a RAII type marked [[no_unique_address]] that takes care of disconnecting all slots on its current derived "level". Though it would be C++20 only.

      Attachments

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

        Activity

          People

            manordheim Mårten Nordheim
            manordheim Mårten Nordheim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes