From bda6200192b25b4cbb5b0bed027509d67e31c97b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 16 Feb 2023 10:52:07 +0100 Subject: QtQml: Clean up QQmlMetaObject::canConvert() I don't see how the previous implementation makes any sense. It seems to be a remnant of a time when QMetaObject::inherits() didn't work reliably. Task-number: QTBUG-94807 Change-Id: I9b7a25aa641185c263ddc6d91553400259e4a311 Reviewed-by: Qt CI Bot Reviewed-by: Fabian Kosmale --- src/qml/qml/qqmlmetaobject_p.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/qml/qml/qqmlmetaobject_p.h') diff --git a/src/qml/qml/qqmlmetaobject_p.h b/src/qml/qml/qqmlmetaobject_p.h index cc3cc6af79..288779c74c 100644 --- a/src/qml/qml/qqmlmetaobject_p.h +++ b/src/qml/qml/qqmlmetaobject_p.h @@ -67,7 +67,11 @@ public: bool constructorParameterTypes(int index, ArgTypeStorage *dummy, QByteArray *unknownTypeError) const; - static bool canConvert(const QQmlMetaObject &from, const QQmlMetaObject &to); + static bool canConvert(const QQmlMetaObject &from, const QQmlMetaObject &to) + { + Q_ASSERT(!from.isNull() && !to.isNull()); + return from.metaObject()->inherits(to.metaObject()); + } // static_metacall (on Gadgets) doesn't call the base implementation and therefore // we need a helper to find the correct meta object and property/method index. -- cgit v1.2.3