Qt warning of type conversion already registered
-
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? -
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?
-
@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.
-
@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.