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

Remove dependency on Q_DECLARE_METATYPE for queued connections

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • 6.10
    • None
    • Core: Object Model
    • None
    • 25
    • Foundation Sprint 123, Foundation Sprint 124, Foundation Sprint 125

    Description

      With Qt 6, we had the goal of making Q_DECLARE_METATYPE superfluous. There are however a few areas which still rely on it, queued connections (and queued invoke) being one of them.

      As sketched in https://codereview.qt-project.org/c/qt/qtbase/+/528871, it should mostly be possible to relax the restriction to requiring that the type is complete [1].

      This would remove the most common remaining use case for using Q_DELCARE_METATYPE in user projects, and thus remove an annoying gotcha.

      Acceptance criteria:

      • No existing code breaks
      • Both string-based and new style connections will work for types not using Q_DECLARE_METATYPE. string based connections can require that the arguments are registered (in the QMetaType::register sense) [2].
      • We're not adding a significant amount of compile time overhead compared to what we currently have.

      Non goals:

      • This task is not about completely removing Q_DECLARE_METATYPE (that needs further work of/investigation on the conversion logic)
      • Nor is it about refactoring the connect logic to be based on QMetaTypeInterface instead of ints (QMetaType ids). That might also be useful, but can probably be done in a separate step.

      [1] Which is guaranteed to be the case when we had Q_DECLARE_METATYPE, as Q_DECLARE_METATYPE requires complete types, too.
      [2] This shouldn't be a new requirement; but that needs to be verified, too.

      Attachments

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

        Activity

          People

            mmutz Marc Mutz
            fabiankosmale Fabian Kosmale
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes