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

Deprecate QObject::disconnect(nullptr, nullptr, nullptr)

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.4.1
    • Core: Object Model
    • None

      As a result of the discussion in QTBUG-83387 it was realized that the invocation of the disconnect all Signals Method in QObject can cause unwanted side effects and even crashes.

      Known crashes occur in context of the Qt accessibility implementation on Windows, where QObjects are tracked via the destroyed signal und disconnecting all signals causes dangling pointers.

      I therefore suggest to deprecate this method, to add a more explicit disconnectAll method instead and maybe to add runtime warnings when used on QWidget/QQuickItem objects.

      The side effects are documented, but using the "disconnect all" functionality is just too tempting for developers so the API should help to prevent issues like this.

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

            cnn Qt Core & Network
            njeisecke Nils Jeisecke
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes