From a298775dffb7800b14f74a1b435944b7294728b5 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 25 Aug 2020 16:04:37 +0200 Subject: Remove deprecated functions involving attached property IDs [ChangeLog][QML] The deprecated functions qmlAttachedPropertiesObjectById and qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool) have been removed. Use the qmlAttachedPropertiesObject(QObject *, QQmlAttachedPropertiesFunc, bool) overload of qmlAttachedPropertiesObject instead. Change-Id: I6bc8315557733dc2f51b2ffdebeec51873b74b2b Reviewed-by: Ulf Hermann --- src/qml/qml/qqmlengine.cpp | 49 ---------------------------------------------- 1 file changed, 49 deletions(-) (limited to 'src/qml/qml/qqmlengine.cpp') diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index cc11535ba8..d7cca8e3fc 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1542,43 +1542,6 @@ static QObject *resolveAttachedProperties(QQmlAttachedPropertiesFunc pf, QQmlDat return rv; } -#if QT_DEPRECATED_SINCE(5, 14) -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - -QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool create) -{ - QQmlData *data = QQmlData::get(object, create); - - // Attached properties are only on objects created by QML, - // unless explicitly requested (create==true) - if (!data) - return nullptr; - - QQmlEnginePrivate *engine = QQmlEnginePrivate::get(data->context); - - const QQmlType type = QQmlMetaType::qmlType(id, QQmlMetaType::TypeIdCategory::QmlType); - return resolveAttachedProperties(type.attachedPropertiesFunction(engine), data, - const_cast(object), create); -} - -QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object, - const QMetaObject *attachedMetaObject, bool create) -{ - if (*idCache == -1) { - QQmlEngine *engine = object ? qmlEngine(object) : nullptr; - *idCache = QQmlMetaType::attachedPropertiesFuncId(engine ? QQmlEnginePrivate::get(engine) : nullptr, attachedMetaObject); - } - - if (*idCache == -1 || !object) - return nullptr; - - return qmlAttachedPropertiesObjectById(*idCache, object, create); -} - -QT_WARNING_POP -#endif - QQmlAttachedPropertiesFunc qmlAttachedPropertiesFunction(QObject *object, const QMetaObject *attachedMetaObject) { @@ -1625,18 +1588,6 @@ Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *obj) return QtQml::qmlEngine(obj); } -Q_QML_EXPORT QObject *qmlAttachedPropertiesObjectById(int id, const QObject *obj, bool create) -{ - return QtQml::qmlAttachedPropertiesObjectById(id, obj, create); -} - -Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object, - const QMetaObject *attachedMetaObject, - bool create) -{ - return QtQml::qmlAttachedPropertiesObject(idCache, object, attachedMetaObject, create); -} - QT_WARNING_POP #endif // QT_DEPRECATED_SINCE(5, 1) -- cgit v1.2.3