aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-12-10 15:56:47 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-12-11 15:35:31 +0100
commitc64b79f89ebc117fa0a422c2da232e2420915b33 (patch)
treef187a56e0b59aee4ad4cad3c3c0ba59e3ed862fa /src/qml/qml/qqmlmetatype.cpp
parent11cc62f3c7b8002293b6ab6e5017ec8d72963ed4 (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/qqmlmetatype.cpp')
-rw-r--r--src/qml/qml/qqmlmetatype.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 9dea173127..f3035209ce 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -1088,7 +1088,7 @@ QList<QQmlPrivate::AutoParentFunction> QQmlMetaType::parentFunctions()
QObject *QQmlMetaType::toQObject(const QVariant &v, bool *ok)
{
- if (!isQObject(v.userType())) {
+ if (!v.metaType().flags().testFlag(QMetaType::PointerToQObject)) {
if (ok) *ok = false;
return nullptr;
}