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

Fix documentation for qRegisterMetaType()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2.0
    • Core: Object Model
    • None
    • All

    Description

      Docs for Q_DECLARE_METATYPE() says currently:

      Note that if you intend to use the type in queued signal and slot connections or in QObject's property system, you also have to call qRegisterMetaType() since the names are resolved at runtime.

      And for qRegisterMetaType():

      To use the type T in queued signal and slot connections, qRegisterMetaType<T>() must be called before the first connection is established.

      This is basically true when we are using string-based connections. It looks like with typed connections the call to qRegisterMetaType() isn't needed anymore (in contrary to Qt 5.15), even for queued connections, as no runtime names resolving is involved in this case.

      Attachments

        Activity

          People

            thiago Thiago Macieira
            jkobus Jarek Kobus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: