From de304af3600ab53218191f00d7728cdcdd07b4a8 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 17 Jun 2022 14:02:55 +0200 Subject: Fix BC break in qqmlist.h We need to retain the implementations for the ctors. Also, since the original change only made it into 6.4, it cannot be deprecated in 6.3. Change-Id: Iab2f1092ddebe5c1a20ec51c7feabb0197c057bc Reviewed-by: Fabian Kosmale (cherry picked from commit feca571240e553b56fc87ca60fea9e405fd12ac3) Reviewed-by: Qt Cherry-pick Bot --- src/qml/qml/qqmllist.cpp | 33 +++++++++++++++++++++++++++++++++ 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); -- cgit v1.2.3