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

Make QMetaType::registerConverterFunction public

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.13.1
    • Core: Other
    • None
    • Windows

    Description

      Hi

      I know it's rather a corner case, but my project requires to callQMetaType::registerConverterFunction, ie. allow to register conversion functions with metatype ids rather than C++ types. My project uses an abstraction layer, everything is rather generic and dynamic, and compile-time types are not known when I need to register my conversion functions.

      So far I've been able to use it, because an internal workaround makes it public with my compiler (MSVC), but of course it fails to compile in other environments, and won't compile anymore with Qt6.

      I don't see any strong reason to hide it, except maybe the inability to perform a compile-time check that both types are not built-in Qt types, like template functions on top of it do, but this could easily be done with a cheap runtime check such as "type >= QMetaType::User".

      Let me know what you think.

      Thanks.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            laurentgom Laurent
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes