diff options
-rw-r--r-- | src/qml/qml/qqmllist.cpp | 33 | ||||
-rw-r--r-- | src/qml/qml/qqmllist.h | 8 |
2 files changed, 36 insertions, 5 deletions
diff --git a/src/qml/qml/qqmllist.cpp b/src/qml/qml/qqmllist.cpp index 7adec6a725..49fcc9bc0e 100644 --- a/src/qml/qml/qqmllist.cpp +++ b/src/qml/qml/qqmllist.cpp @@ -88,6 +88,39 @@ QQmlListReference::QQmlListReference() { } +#if QT_DEPRECATED_SINCE(6, 4) +/*! +\since 6.1 +\obsolete [6.4] Use the constructors without QQmlEngine argument instead. + +Constructs a QQmlListReference from a QVariant \a variant containing a QQmlListProperty. If +\a variant does not contain a list property, an invalid QQmlListReference is created. If the object +owning the list property is destroyed after the reference is constructed, it will automatically +become invalid. That is, it is safe to hold QQmlListReference instances even after the object is +deleted. + +The \a engine is unused. +*/ +QQmlListReference::QQmlListReference(const QVariant &variant, [[maybe_unused]] QQmlEngine *engine) + : QQmlListReference(variant) +{} + +/*! +\obsolete [6.4] Use the constructors without QQmlEngine argument instead. + +Constructs a QQmlListReference for \a object's \a property. If \a property is not a list +property, an invalid QQmlListReference is created. If \a object is destroyed after +the reference is constructed, it will automatically become invalid. That is, it is safe to hold +QQmlListReference instances even after \a object is deleted. + +The \a engine is unused. +*/ +QQmlListReference::QQmlListReference(QObject *object, const char *property, + [[maybe_unused]] QQmlEngine *engine) + : QQmlListReference(object, property) +{} +#endif + /*! \since 6.1 diff --git a/src/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h index 6b5c927f69..051f3d67ff 100644 --- a/src/qml/qml/qqmllist.h +++ b/src/qml/qml/qqmllist.h @@ -162,14 +162,12 @@ class Q_QML_EXPORT QQmlListReference public: QQmlListReference(); -#if QT_DEPRECATED_SINCE(6, 3) +#if QT_DEPRECATED_SINCE(6, 4) QT_DEPRECATED_X("Drop the QQmlEngine* argument") - QQmlListReference(const QVariant &variant, QQmlEngine *) - : QQmlListReference(variant) {} + QQmlListReference(const QVariant &variant, [[maybe_unused]] QQmlEngine *engine); QT_DEPRECATED_X("Drop the QQmlEngine* argument") - QQmlListReference(QObject *o, const char *property, QQmlEngine *) - : QQmlListReference(o, property) {} + QQmlListReference(QObject *o, const char *property, [[maybe_unused]] QQmlEngine *engine); #endif explicit QQmlListReference(const QVariant &variant); |