From 524c187af3bcd532f345eed61be7bd99732d0505 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 11 May 2021 10:52:34 +0200 Subject: QProperty: Cleanup QPropertyAlias leftovers This removes traces of QPropertyAlias which is internal API which is a) not really working even before this change (no compatibility with QBindableInterface due to QPropertyAlias not being derived from QUntypedPropertyData) b) not used anywhere For BIC reasons, we need to keep some methods still around until Qt 7, though. Change-Id: I5bb4735a4c88cba275dc2cc6e29a46ca09622059 Reviewed-by: Qt CI Bot Reviewed-by: Ulf Hermann --- src/corelib/kernel/qproperty.cpp | 20 +++----------------- src/corelib/kernel/qproperty.h | 4 +--- src/corelib/kernel/qproperty_p.h | 1 - 3 files changed, 4 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index a1b2f83c5b..d8176a845a 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -571,10 +571,9 @@ QPropertyObserver::QPropertyObserver(ChangeHandler changeHandler) d.setChangeHandler(changeHandler); } -QPropertyObserver::QPropertyObserver(QUntypedPropertyData *aliasedPropertyPtr) +QPropertyObserver::QPropertyObserver(QUntypedPropertyData *) { - QPropertyObserverPointer d{this}; - d.setAliasedProperty(aliasedPropertyPtr); + // ### Qt 7: Remove, currently left for binary compatibility } /*! \internal @@ -625,8 +624,6 @@ QPropertyObserver &QPropertyObserver::operator=(QPropertyObserver &&other) noexc void QPropertyObserverPointer::unlink() { - if (ptr->next.tag() == QPropertyObserver::ObserverNotifiesAlias) - ptr->aliasedPropertyData = nullptr; if (ptr->next) ptr->next->prev = ptr->prev; if (ptr->prev) @@ -642,13 +639,6 @@ void QPropertyObserverPointer::setChangeHandler(QPropertyObserver::ChangeHandler ptr->next.setTag(QPropertyObserver::ObserverNotifiesChangeHandler); } -void QPropertyObserverPointer::setAliasedProperty(QUntypedPropertyData *property) -{ - Q_ASSERT(ptr->next.tag() != QPropertyObserver::ObserverIsPlaceholder); - ptr->aliasedPropertyData = property; - ptr->next.setTag(QPropertyObserver::ObserverNotifiesAlias); -} - void QPropertyObserverPointer::setBindingToNotify(QPropertyBindingPrivate *binding) { Q_ASSERT(ptr->next.tag() != QPropertyObserver::ObserverIsPlaceholder); @@ -708,9 +698,6 @@ void QPropertyObserverPointer::notify(QUntypedPropertyData *propertyDataPtr) */ while (observer) { QPropertyObserver *next = observer->next.data(); - - char preventBug[1] = {'\0'}; // QTBUG-87245 - Q_UNUSED(preventBug); switch (QPropertyObserver::ObserverTag(observer->next.tag())) { case QPropertyObserver::ObserverNotifiesChangeHandler: { @@ -734,11 +721,10 @@ void QPropertyObserverPointer::notify(QUntypedPropertyData *propertyDataPtr) next = protector.next(); break; } - case QPropertyObserver::ObserverNotifiesAlias: - break; case QPropertyObserver::ObserverIsPlaceholder: // recursion is already properly handled somewhere else break; + default: Q_UNREACHABLE(); } observer = next; } diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index f5513be73f..a2c2875a12 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -215,7 +215,6 @@ public: enum ObserverTag { ObserverNotifiesBinding, // observer was installed to notify bindings that obsverved property changed ObserverNotifiesChangeHandler, // observer is a change handler, which runs on every change - ObserverNotifiesAlias, // used for QPropertyAlias ObserverIsPlaceholder // the observer before this one is currently evaluated in QPropertyObserver::notifyObservers. }; protected: @@ -237,7 +236,6 @@ private: union { QPropertyBindingPrivate *binding = nullptr; ChangeHandler changeHandler; - QUntypedPropertyData *aliasedPropertyData; }; }; @@ -260,7 +258,7 @@ protected: QUntypedPropertyData *aliasedProperty() const { - return aliasedPropertyData; + return nullptr; } private: diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index d00094c54f..32ff31166c 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -105,7 +105,6 @@ struct QPropertyObserverPointer void setBindingToNotify(QPropertyBindingPrivate *binding); void setChangeHandler(QPropertyObserver::ChangeHandler changeHandler); - void setAliasedProperty(QUntypedPropertyData *propertyPtr); void notify(QUntypedPropertyData *propertyDataPtr); #ifndef QT_NO_DEBUG -- cgit v1.2.3