diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-25 16:04:37 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-25 23:17:16 +0200 |
commit | a298775dffb7800b14f74a1b435944b7294728b5 (patch) | |
tree | 0ce7bf5bd585f52177d8981d78304a7c0688a256 /src/qml/qml/qqmlengine.cpp | |
parent | 23dd5db4f1f612e962b408c26e9cfd276a5348a3 (diff) |
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 <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 49 |
1 files changed, 0 insertions, 49 deletions
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<QObject *>(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) |