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

QObjectPrivate::receiverList() may be incorrect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.11.0 Beta 2
    • Core: Object Model
    • None

    Description

      It doesn't look right:

      // Used by QAccessibleWidget
      QObjectList QObjectPrivate::receiverList(const char *signal) const
      {
          Q_Q(const QObject);
          QObjectList returnValue;
          int signal_index = signalIndex(signal);
          if (signal_index < 0)
              return returnValue;
          QMutexLocker locker(signalSlotLock(q));
          if (connectionLists) {
              if (signal_index < connectionLists->count()) {
                  const QObjectPrivate::Connection *c = connectionLists->at(signal_index).first;
      
                  while (c) {
                      if (c->receiver)
                          returnValue << c->receiver;
                      c = c->nextConnectionList;
                  }
              }
          }
          return returnValue;
      }
      

      It is indeed used only by QAccessibleWidget and has no autotest, so a bug might go unnoticed.

      I wanted to use it to find connections to signals from Pointer Handlers in Qt Quick (which may or may not be a good idea) and in one case I could see that signal_index == 20 but connectionLists is a QVector<QObjectPrivate::ConnectionList>, each of which can have multiple connections. connectionLists->count() == 1 in this case, but that's not the whole count of all connections, so it doesn't seem like the right comparison to be doing here.

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes