diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-11-14 10:30:02 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-11-18 10:37:59 +0100 |
commit | 9b2af0c5f581797e0098494efa93365a2dc6d0bf (patch) | |
tree | 05150d0c0dc8fbf9da70a7aa2416fc1b97c2e2f9 /src/qml/qml/qqmlmetatype.cpp | |
parent | c5675c9c8f549beb9966644277010eb847c72bcd (diff) |
Retrieve the attached properties base type without recursion
This is probably faster and avoids the deprecation warnings stemming
from deprecated functions calling themselves recursively.
Task-number: QTBUG-80040
Change-Id: I2f65aad3bc7f85b7a7de66d3e76dac1233a58db8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index c2674b402a..4f2089b60d 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -924,11 +924,11 @@ int QQmlMetaType::attachedPropertiesFuncId(QQmlEnginePrivate *engine, const QMet for (auto it = data->metaObjectToType.constFind(mo), end = data->metaObjectToType.constEnd(); it != end && it.key() == mo; ++it) { - const QQmlType type(it.value()); - if (type.attachedPropertiesFunction(engine)) - return type.attachedPropertiesId(engine); + if (const QQmlTypePrivate *type = it.value()) { + if (const QQmlTypePrivate *base = type->attachedPropertiesBase(engine)) + return base->index; + } } - return -1; } |