I faced the same behavior, which was unexpected and undocumented. I was debugging Qt, and at the end there is the following fallback in their code.
int registerHelper() const
{
if (d_ptr) {
if (int id = d_ptr->typeId.loadRelaxed())
return id;
return registerHelper(d_ptr);
}
return 0;
}
int QMetaType::registerHelper(const QtPrivate::QMetaTypeInterface *iface)
{
Q_ASSERT(iface);
auto reg = customTypeRegistry();
if (reg) {
return reg->registerCustomType(iface);
}
return 0;
}
qtbase\src\corelib\kernel\qmetatype.cpp