diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-02-16 10:52:07 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-02-16 20:55:31 +0100 |
commit | bda6200192b25b4cbb5b0bed027509d67e31c97b (patch) | |
tree | 4735ef71225380ec9d9183cb473bf48be6662992 /src/qml/qml/qqmlmetaobject_p.h | |
parent | f3e981afb4d10c4e249c1738df9afc3d75328986 (diff) |
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 <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetaobject_p.h')
-rw-r--r-- | src/qml/qml/qqmlmetaobject_p.h | 6 |
1 files changed, 5 insertions, 1 deletions
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. |