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 | |
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')
-rw-r--r-- | src/qml/qml/qqml.h | 7 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 49 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 24 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype_p.h | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmltype.cpp | 14 | ||||
-rw-r--r-- | src/qml/qml/qqmltype_p.h | 3 |
6 files changed, 0 insertions, 103 deletions
diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index b5c3b77f39..bd608c5c99 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -640,13 +640,6 @@ namespace QtQml { Q_QML_EXPORT void qmlExecuteDeferred(QObject *); Q_QML_EXPORT QQmlContext *qmlContext(const QObject *); Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *); -#if QT_DEPRECATED_SINCE(5, 14) - Q_QML_EXPORT QT_DEPRECATED_VERSION_X_5_14("Use qmlAttachedPropertiesObject(QObject *, QQmlAttachedPropertiesFunc, bool") - QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true); - Q_QML_EXPORT QT_DEPRECATED_VERSION_X_5_14("Use qmlAttachedPropertiesObject(QObject *, QQmlAttachedPropertiesFunc, bool") - QObject *qmlAttachedPropertiesObject( - int *, const QObject *, const QMetaObject *, bool create); -#endif Q_QML_EXPORT QQmlAttachedPropertiesFunc qmlAttachedPropertiesFunction(QObject *, const QMetaObject *); Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(QObject *, QQmlAttachedPropertiesFunc func, 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) diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index ad67b8abc0..9b0df3c5c4 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1034,30 +1034,6 @@ int QQmlMetaType::listType(int id) return 0; } -#if QT_DEPRECATED_SINCE(5, 14) -int QQmlMetaType::attachedPropertiesFuncId(QQmlEnginePrivate *engine, const QMetaObject *mo) -{ - QQmlMetaTypeDataPtr data; - - for (auto it = data->metaObjectToType.constFind(mo), end = data->metaObjectToType.constEnd(); - it != end && it.key() == mo; ++it) { - if (const QQmlTypePrivate *type = it.value()) { - if (const QQmlTypePrivate *base = type->attachedPropertiesBase(engine)) - return base->index; - } - } - return -1; -} - -QQmlAttachedPropertiesFunc QQmlMetaType::attachedPropertiesFuncById(QQmlEnginePrivate *engine, int id) -{ - if (id < 0) - return nullptr; - QQmlMetaTypeDataPtr data; - return data->types.at(id).attachedPropertiesFunction(engine); -} -#endif - QQmlAttachedPropertiesFunc QQmlMetaType::attachedPropertiesFunc(QQmlEnginePrivate *engine, const QMetaObject *mo) { diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h index 564a4adcf2..58968a1c26 100644 --- a/src/qml/qml/qqmlmetatype_p.h +++ b/src/qml/qml/qqmlmetatype_p.h @@ -142,12 +142,6 @@ public: static QObject *toQObject(const QVariant &, bool *ok = nullptr); static int listType(int); -#if QT_DEPRECATED_SINCE(5, 14) - static QT_DEPRECATED int attachedPropertiesFuncId(QQmlEnginePrivate *engine, - const QMetaObject *); - static QT_DEPRECATED QQmlAttachedPropertiesFunc attachedPropertiesFuncById(QQmlEnginePrivate *, - int); -#endif static QQmlAttachedPropertiesFunc attachedPropertiesFunc(QQmlEnginePrivate *, const QMetaObject *); diff --git a/src/qml/qml/qqmltype.cpp b/src/qml/qml/qqmltype.cpp index bdca223bae..48fb2e2342 100644 --- a/src/qml/qml/qqmltype.cpp +++ b/src/qml/qml/qqmltype.cpp @@ -635,20 +635,6 @@ const QMetaObject *QQmlType::attachedPropertiesType(QQmlEnginePrivate *engine) c return nullptr; } -#if QT_DEPRECATED_SINCE(5, 14) -/* -This is the id passed to qmlAttachedPropertiesById(). This is different from the index -for the case that a single class is registered under two or more names (eg. Item in -Qt 4.7 and QtQuick 1.0). -*/ -int QQmlType::attachedPropertiesId(QQmlEnginePrivate *engine) const -{ - if (const QQmlTypePrivate *base = d->attachedPropertiesBase(engine)) - return base->index; - return -1; -} -#endif - int QQmlType::parserStatusCast() const { if (!d || d->regType != CppType) diff --git a/src/qml/qml/qqmltype_p.h b/src/qml/qml/qqmltype_p.h index 99f4e95bf7..ac718e2fd4 100644 --- a/src/qml/qml/qqmltype_p.h +++ b/src/qml/qml/qqmltype_p.h @@ -135,9 +135,6 @@ public: QQmlAttachedPropertiesFunc attachedPropertiesFunction(QQmlEnginePrivate *engine) const; const QMetaObject *attachedPropertiesType(QQmlEnginePrivate *engine) const; -#if QT_DEPRECATED_SINCE(5, 14) - QT_DEPRECATED int attachedPropertiesId(QQmlEnginePrivate *engine) const; -#endif int parserStatusCast() const; const char *interfaceIId() const; |