If there is no meta object for the property type of the recipient of
an invalid binding, fall back to QMetaType::typename().
Task-number: QTBUG-25161
Change-Id: I0bb768cbc166c04f62d20d8bb19e6ae883d7dc2f
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
if (QObject *o = *(QObject **)value.constData()) {
valueType = o->metaObject()->className();
- const QMetaObject *propertyMetaObject = rawMetaObjectForType(QQmlEnginePrivate::get(engine), type);
- propertyType = propertyMetaObject->className();
+ if (const QMetaObject *propertyMetaObject = rawMetaObjectForType(QQmlEnginePrivate::get(engine), type)) {
+ propertyType = propertyMetaObject->className();
+ }
}
} else if (value.userType() != QVariant::Invalid) {
valueType = QMetaType::typeName(value.userType());
Text {
id: myText
+
+ anchors.verticalCenter: parent // invalid binding
}
}
expectedWarning = testUrl.toString() + QString::fromLatin1(":7:36: Unable to assign QQuickText to QQuickRectangle");
QTest::ignoreMessage(QtWarningMsg, expectedWarning.toLatin1().constData());
+ // V8 error message for invalid binding to anchor
+ expectedWarning = testUrl.toString() + QString::fromLatin1(":14: Unable to assign QQuickItem_QML_7 to QQuickAnchorLine");
+ QTest::ignoreMessage(QtWarningMsg, expectedWarning.toLatin1().constData());
+
QQmlComponent component(&engine, testUrl);
QObject *obj = component.create();
QVERIFY(obj);