QVariant: Print a warning when deserialized user type is unknown

The deserialized user type is now shown to the user to figure which
QMetaType registration is missing.

Change-Id: I4b7624827e479b1bea67065ce3542183b7355165
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
bb10
Michael Winkelmann 2017-07-05 14:43:30 +02:00
parent 594fe5c463
commit 7d42293d2f
1 changed files with 1 additions and 0 deletions

View File

@ -2070,6 +2070,7 @@ void QVariant::load(QDataStream &s)
typeId = QMetaType::type(name.constData());
if (typeId == QMetaType::UnknownType) {
s.setStatus(QDataStream::ReadCorruptData);
qWarning("QVariant::load: unknown user type with name %s.", name.constData());
return;
}
}