aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-22 01:00:07 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-04-23 09:53:31 +0200
commit0cf8e2fb974370fd6d370f92fa22fa2245bcebb0 (patch)
treef7b471bd8abb111e32a220bca24bd508b7871cca /src/qml/qml/qqmlmetatype.cpp
parentc00283bb3bb966bf60c307ec8283bd98c12318bf (diff)
parent53bd6b8111eb0d7f23b3b0ca95bef4735f7a952c (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: src/qml/qml/qqmlmetatype.cpp Change-Id: Ieff61c076e46eb50a059c8b0210f7f4d7ce0cbcf
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r--src/qml/qml/qqmlmetatype.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 32f281b4f2..980f8469f1 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -143,12 +143,6 @@ static QQmlTypePrivate *createQQmlType(QQmlMetaTypeData *data, const QString &el
d->baseMetaObject = type.metaObject;
d->extraData.cd->attachedPropertiesFunc = type.attachedPropertiesFunction;
d->extraData.cd->attachedPropertiesType = type.attachedPropertiesMetaObject;
- if (d->extraData.cd->attachedPropertiesType) {
- d->extraData.cd->attachedPropertiesId = data->attachedPropertyId(d->baseMetaObject,
- d->index);
- } else {
- d->extraData.cd->attachedPropertiesId = -1;
- }
d->extraData.cd->parserStatusCast = type.parserStatusCast;
d->extraData.cd->propertyValueSourceCast = type.valueSourceCast;
d->extraData.cd->propertyValueInterceptorCast = type.valueInterceptorCast;
@@ -599,19 +593,6 @@ void QQmlMetaType::registerUndeletableType(const QQmlType &dtype)
data->undeletableTypes.insert(dtype);
}
-int QQmlMetaType::registerAttachedPropertyId(const QMetaObject *metaObject, int index)
-{
- QQmlMetaTypeDataPtr data;
- return data->attachedPropertyId(metaObject, index);
-}
-
-bool QQmlMetaType::unregisterAttachedPropertyId(const QMetaObject *metaObject, int index)
-{
- QQmlMetaTypeDataPtr data;
- // This is run from the QQmlType dtor. QQmlTypes in user code can outlive QQmlMetaTypeData.
- return data ? data->removeAttachedPropertyId(metaObject, index) : false;
-}
-
static bool namespaceContainsRegistrations(const QQmlMetaTypeData *data, const QString &uri,
int majorVersion)
{
@@ -938,6 +919,15 @@ QQmlAttachedPropertiesFunc QQmlMetaType::attachedPropertiesFuncById(QQmlEnginePr
return data->types.at(id).attachedPropertiesFunction(engine);
}
+QQmlAttachedPropertiesFunc QQmlMetaType::attachedPropertiesFunc(QQmlEnginePrivate *engine,
+ const QMetaObject *mo)
+{
+ QQmlMetaTypeDataPtr data;
+
+ QQmlType type(data->metaObjectToType.value(mo));
+ return type.attachedPropertiesFunction(engine);
+}
+
QMetaProperty QQmlMetaType::defaultProperty(const QMetaObject *metaObject)
{
int idx = metaObject->indexOfClassInfo("DefaultProperty");