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

Superfluous calls to int qRegisterMetaType(const char *typeName)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.0, 6.1, 6.2
    • Fix Version/s: 6.2.0 Alpha, 6.2
    • Component/s: Core: Object Model
    • Labels:
      None
    • Commits:
      33a2bd9ca9ee3dc05e5f7cb48aa8f1d55f5368b2 (qt/qtbase/dev)

      Description

      Q_DECLARE_METATYPE still expands to a struct containing a qt_metatype_id function. That one is called as the legacy register operation the first time we're trying to access the id of the metatype.

       

      qt_metatype_id will in turn normalize the name it was provided with, and afterwards call qRegisterNormalizedMetatype. This is arguably still necessary to support the case where the user provided name does not match the "real" name due to namespaces.  In most cases, the normalized name however does equal the type name, and in those cases we register the type as a typedef of itself (via QMetaType::registerNormalizedType).

       

      As type normalization is a rather costly operation, and registering those typedefs is wasteful, we should skip that work.

        Attachments

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

          Activity

            People

            Assignee:
            fabiankosmale Fabian Kosmale
            Reporter:
            fabiankosmale Fabian Kosmale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes