Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt warning of type conversion already registered
Qt 6.11 is out! See what's new in the release blog

Qt warning of type conversion already registered

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nyaruko
    wrote on last edited by
    #1

    I have a multi-thread Qt program where the Qt sometimes give a warning:

    Type conversion already registered from type QPair<QByteArray,QByteArray> to type QtMetaTypePrivate::QPairVariantInterfaceImpl
    

    I have found the warning is from this Qt's function:

    @bool QMetaType::registerConverterFunction(QtPrivate::AbstractConverterFunction *f, int from, int to)
    {
    if (!customTypesConversionRegistry()->insertIfNotContains(from, to, f)) {
    qWarning("Type conversion already registered from type %s to type %s",
    QMetaType::typeName(from), QMetaType::typeName(to));
    if (f)
    f->destroy(f);
    return false;
    }
    return true;
    }
    @
    I have checked my own code, nobody is calling this function, so it must be inside Qt's own function.
    Could any one give me a hint what's causing this issue or which function actually called the above function inside Qt's code.
    I am using Qt 5.3.2.
    I wonder whether this could be a Qt's bug instead of mine?

    1 Reply Last reply
    0
    • ocgltdO Offline
      ocgltdO Offline
      ocgltd
      wrote on last edited by
      #2

      This is a 10 year old post - but no reply. I have the exact same symptom:

      Type conversion already registered from type QPair<QByteArray,QByteArray> to type QtMetaTypePrivate::QPairVariantInterfaceImpl

      and I don't think I register this type (suggesting it's in Qt's own files). Any way to track this down?

      Christian EhrlicherC C 2 Replies Last reply
      0
      • ocgltdO ocgltd

        This is a 10 year old post - but no reply. I have the exact same symptom:

        Type conversion already registered from type QPair<QByteArray,QByteArray> to type QtMetaTypePrivate::QPairVariantInterfaceImpl

        and I don't think I register this type (suggesting it's in Qt's own files). Any way to track this down?

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @ocgltd said in Qt warning of type conversion already registered:

        Any way to track this down?

        Add a breakpoint in the function where the warning is created and look at the backtrace to see from where it comes.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • ocgltdO ocgltd

          This is a 10 year old post - but no reply. I have the exact same symptom:

          Type conversion already registered from type QPair<QByteArray,QByteArray> to type QtMetaTypePrivate::QPairVariantInterfaceImpl

          and I don't think I register this type (suggesting it's in Qt's own files). Any way to track this down?

          C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          @nyaruko said in Qt warning of type conversion already registered:

          I have a multi-thread Qt program...

          This is a common cause of issues of all flavours. It may be as simple as the same setup code for shared configuration, e.g. the metatype database, executing in multiple threads.

          @ocgltd said in Qt warning of type conversion already registered:

          Any way to track this down?

          You could provide a minimal program that invokes the message, some basic Qt version information, tool chain information, etc. Something that happens twice in ten years here and spans many Qt versions is not likely to have an immediate, "I've seen that before," response.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved