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

    • Sub-task
    • Resolution: Done
    • P1: Critical
    • 5.0.0
    • Core: Object Model
    • None
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: