From da9d5016613d04f002c6433e2b3083143fec34cb Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 13 Jun 2014 16:04:39 +0200 Subject: Fix Managed::as<>() method The as<> casting method was not doing the right thing in 100% of the cases. It only checked if the object in question was exactly of the type being asked for. It however didn't check if the object was derived from the type. This commit fixes this by adding a parent chain to the vtables, that is then being used to check this safely at runtime. Change-Id: I9e0b13adbda668aee8c7451e2bb71cd6d4e316d9 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmllistwrapper_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/qml/qqmllistwrapper_p.h') diff --git a/src/qml/qml/qqmllistwrapper_p.h b/src/qml/qml/qqmllistwrapper_p.h index 670321bcd7..70f686b73c 100644 --- a/src/qml/qml/qqmllistwrapper_p.h +++ b/src/qml/qml/qqmllistwrapper_p.h @@ -84,7 +84,7 @@ struct Q_QML_EXPORT QmlListWrapper : Object int propertyType; } __data; - V4_OBJECT + V4_OBJECT(Object) static ReturnedValue create(QV8Engine *v8, QObject *object, int propId, int propType); static ReturnedValue create(QV8Engine *v8, const QQmlListProperty &prop, int propType); -- cgit v1.2.3