diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-06-21 14:04:12 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-06-22 08:23:34 +0200 |
commit | 6654637a46eda100f20eec9146a9dafb232ec0a9 (patch) | |
tree | 7ad88fcc7e1ca63d82b6a5b92d78d6bc7e7dbab1 /src/qml/qml/qqmlglobal_p.h | |
parent | 7a3448a8e4c56d6adc40ef5887c2f12ce7b68d64 (diff) |
QtQml: Rename qmlobject_can_cast
We want a version that only casts using the first C++ metaobject, and
another one that takes the full QML type hierarchy into account.
Change-Id: Ie23cf774f7837955de63d5ccb6c7cead1d1948f2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlglobal_p.h')
-rw-r--r-- | src/qml/qml/qqmlglobal_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h index bb710b059d..ce18cfb1e1 100644 --- a/src/qml/qml/qqmlglobal_p.h +++ b/src/qml/qml/qqmlglobal_p.h @@ -122,7 +122,8 @@ do { \ QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); \ } while (0) -Q_QML_PRIVATE_EXPORT bool qmlobject_can_cast(QObject *object, const QMetaObject *mo); +Q_QML_PRIVATE_EXPORT bool qmlobject_can_cpp_cast(QObject *object, const QMetaObject *mo); +Q_QML_PRIVATE_EXPORT bool qmlobject_can_qml_cast(QObject *object, const QMetaObject *mo); /*! This method is identical to qobject_cast<T>() except that it does not require lazy @@ -141,7 +142,7 @@ T qmlobject_cast(QObject *object) { if (!object) return nullptr; - if (qmlobject_can_cast(object, &(std::remove_pointer_t<T>::staticMetaObject))) + if (qmlobject_can_cpp_cast(object, &(std::remove_pointer_t<T>::staticMetaObject))) return static_cast<T>(object); else return nullptr; |