Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-20885 Larger changes for Qt 5
  3. QTBUG-25541

QObject::connectNotify() and disconnectNotify() should take a QMetaMethod argument, not const char *

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Fix Version/s: 5.0.0
    • Component/s: Core: Object Model
    • Labels:
      None
    • Technical Risk:
      Normal
    • Commits:
      f544d7189ec8fc5096015a1a649ee2e317efd893 243ea09e4cc0908e28be44e3e6786ff8b73f74be

      Description

      With the new QMetaObject data format introduced in Qt5, full method signatures are no longer stored in the meta-data. (Re)constructing a signature string is costly, and often wasteful (since connect/disconnectNotify() is rarely reimplemented).

      Rather than a const char * as argument, connect/disconnectNotify() should take a QMetaMethod as argument. A QMetaMethod is very cheap to provide (just an index into a method table), and with the QMetaMethod the reimplementing code can query every aspect of the connected signal (including the signature – QMetaMethod::methodSignature()). With the introduction of QMetaMethod::fromSignal(MemberFunction) in Qt5, reimplementers also have a fast and typesafe way of checking which particular signal was (dis)connected (without resorting to raw string comparisons).

        Attachments

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

          Activity

            People

            Assignee:
            kenthans Kent Hansen (Inactive)
            Reporter:
            kenthans Kent Hansen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes