From 3e5152be4100cbe649d252bb5d95dc98be5df2f0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 5 Aug 2016 10:02:52 +0200 Subject: QJSValue: Adapt to introduction of QMetaType::Nullptr [ChangeLog][QtQml][Important Behavior Changes] A JS null value converted to a QVariant now has type QMetaType::Nullptr rather than QMetaType::VoidStar. Change-Id: I91a64e444ada0f1884fe807f9973348ba1a878ff Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlbinding.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/qml/qml/qqmlbinding.cpp') diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index d4a8b87aaa..5c9b14ba74 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -386,7 +386,8 @@ Q_NEVER_INLINE bool QQmlBinding::slowWrite(const QQmlPropertyData &core, const Q const char *valueType = 0; const char *propertyType = 0; - if (value.userType() == QMetaType::QObjectStar) { + const int userType = value.userType(); + if (userType == QMetaType::QObjectStar) { if (QObject *o = *(QObject *const *)value.constData()) { valueType = o->metaObject()->className(); @@ -394,11 +395,11 @@ Q_NEVER_INLINE bool QQmlBinding::slowWrite(const QQmlPropertyData &core, const Q if (!propertyMetaObject.isNull()) propertyType = propertyMetaObject.className(); } - } else if (value.userType() != QVariant::Invalid) { - if (value.userType() == QMetaType::VoidStar) + } else if (userType != QVariant::Invalid) { + if (userType == QMetaType::Nullptr || userType == QMetaType::VoidStar) valueType = "null"; else - valueType = QMetaType::typeName(value.userType()); + valueType = QMetaType::typeName(userType); } if (!valueType) -- cgit v1.2.3