diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-10 15:56:47 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-11 15:35:31 +0100 |
commit | c64b79f89ebc117fa0a422c2da232e2420915b33 (patch) | |
tree | f187a56e0b59aee4ad4cad3c3c0ba59e3ed862fa /src/qml/qml/qqmlengine.cpp | |
parent | 11cc62f3c7b8002293b6ab6e5017ec8d72963ed4 (diff) |
Clean up (QQmlEnginePrivate|QQmlMetaType)::toQObject
All the necessary information is contained in the QVariant's metatype,
so we can use that. This removes the need to acquire the data pointer
lock. The method in QQmlEnginePrivate now simply forwards to
QQmlMetaType; in a later commit, all usages of the forwarding functions
from QQmlEnginePrivate will be replaced with the equivalents from
QQmlMetaType, so that they can be removed from QQmlEnginePrivate.
Task-number: QTBUG-88766
Change-Id: Iebcda9b18b4952fff2c7c1aeae210c677c6869b8
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 0208b99621..ef9fec56fb 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -2196,14 +2196,7 @@ bool QQmlEnginePrivate::isQObject(int t) QObject *QQmlEnginePrivate::toQObject(const QVariant &v, bool *ok) const { - Locker locker(this); - int t = v.userType(); - if (t == QMetaType::QObjectStar || m_compositeTypes.contains(t)) { - if (ok) *ok = true; - return *(QObject *const *)(v.constData()); - } else { - return QQmlMetaType::toQObject(v, ok); - } + return QQmlMetaType::toQObject(v, ok); } QQmlMetaType::TypeCategory QQmlEnginePrivate::typeCategory(int t) const |