diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index b6513a0b71d..9b1a8b56aab 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -678,8 +678,10 @@ QPropertyObserver::QPropertyObserver(ChangeHandler changeHandler) #if QT_DEPRECATED_SINCE(6, 6) QPropertyObserver::QPropertyObserver(QUntypedPropertyData *data) { + QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED aliasData = data; next.setTag(ObserverIsAlias); + QT_WARNING_POP } #endif diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 070907c6080..32d7a445067 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -229,7 +229,7 @@ public: ObserverNotifiesChangeHandler, // observer is a change handler, which runs on every change ObserverIsPlaceholder, // the observer before this one is currently evaluated in QPropertyObserver::notifyObservers. #if QT_DEPRECATED_SINCE(6, 6) - ObserverIsAlias + ObserverIsAlias QT_DEPRECATED_VERSION_X_6_6("Use QProperty and add a binding to the target.") #endif }; protected: @@ -271,7 +271,8 @@ public: protected: QPropertyObserver(ChangeHandler changeHandler); #if QT_DEPRECATED_SINCE(6, 6) - QT_DEPRECATED QPropertyObserver(QUntypedPropertyData *aliasedPropertyPtr); + QT_DEPRECATED_VERSION_X_6_6("This constructor was only meant for internal use. Use QProperty and add a binding to the target.") + QPropertyObserver(QUntypedPropertyData *aliasedPropertyPtr); #endif QUntypedPropertyData *aliasedProperty() const @@ -889,7 +890,7 @@ public: #if QT_DEPRECATED_SINCE(6, 6) template -class QT_DEPRECATED_X("Class was only meant for internal use, use a QProperty and add a binding to the target") +class QT_DEPRECATED_VERSION_X_6_6("Class was only meant for internal use, use a QProperty and add a binding to the target") QPropertyAlias : public QPropertyObserver { Q_DISABLE_COPY_MOVE(QPropertyAlias) @@ -1014,7 +1015,7 @@ public: } QT_WARNING_POP }; -#endif +#endif // QT_DEPRECATED_SINCE(6, 6) template class QObjectBindableProperty : public QPropertyData diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index 277767b3c07..a263fe37307 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -126,15 +126,19 @@ struct QPropertyObserverPointer { unlink_common(); #if QT_DEPRECATED_SINCE(6, 6) + QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED if (ptr->next.tag() == QPropertyObserver::ObserverIsAlias) ptr->aliasData = nullptr; + QT_WARNING_POP #endif } void unlink_fast() { #if QT_DEPRECATED_SINCE(6, 6) + QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED Q_ASSERT(ptr->next.tag() != QPropertyObserver::ObserverIsAlias); + QT_WARNING_POP #endif unlink_common(); } @@ -884,8 +888,10 @@ inline void QPropertyObserverPointer::notify(QUntypedPropertyData *propertyDataP // recursion is already properly handled somewhere else break; #if QT_DEPRECATED_SINCE(6, 6) + QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED case QPropertyObserver::ObserverIsAlias: break; + QT_WARNING_POP #endif default: Q_UNREACHABLE(); }