From 4294e82fe921105bfe137595394705f1c6b16904 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 13 Aug 2020 10:24:45 +0200 Subject: Add const to some methods Change-Id: I60e93e0c9b57468ef4188bdb60a32fb9ac9046e1 Reviewed-by: Maurice Kalinowski --- src/corelib/kernel/qproperty.cpp | 8 ++++---- src/corelib/kernel/qproperty.h | 2 +- src/corelib/kernel/qpropertyprivate.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index 926ccdd8de..6336bd5c58 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -292,7 +292,7 @@ QUntypedPropertyBinding QPropertyBase::setBinding(const QUntypedPropertyBinding return QUntypedPropertyBinding(oldBinding.data()); } -QPropertyBindingPrivate *QPropertyBase::binding() +QPropertyBindingPrivate *QPropertyBase::binding() const { QPropertyBasePointer d{this}; if (auto binding = d.bindingPtr()) @@ -323,7 +323,7 @@ QPropertyBindingPrivate *QPropertyBindingPrivate::currentlyEvaluatingBinding() return currentBindingEvaluationState ? currentBindingEvaluationState->binding : nullptr; } -void QPropertyBase::evaluateIfDirty() +void QPropertyBase::evaluateIfDirty() const { QPropertyBasePointer d{this}; QPropertyBindingPrivate *binding = d.bindingPtr(); @@ -358,7 +358,7 @@ void QPropertyBase::registerWithCurrentlyEvaluatingBinding() const dependencyObserver.observeProperty(d); } -void QPropertyBase::notifyObservers(void *propertyDataPtr) +void QPropertyBase::notifyObservers(void *propertyDataPtr) const { QPropertyBasePointer d{this}; if (QPropertyObserverPointer observer = d.firstObserver()) @@ -385,7 +385,7 @@ QPropertyObserver::QPropertyObserver(void *aliasedPropertyPtr) d.setAliasedProperty(aliasedPropertyPtr); } -void QPropertyObserver::setSource(QPropertyBase &property) +void QPropertyObserver::setSource(const QPropertyBase &property) { QPropertyObserverPointer d{this}; QPropertyBasePointer propPrivate{&property}; diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 1064180c27..1c2aede856 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -597,7 +597,7 @@ protected: } private: - void setSource(QtPrivate::QPropertyBase &property); + void setSource(const QtPrivate::QPropertyBase &property); QTaggedPointer next; // prev is a pointer to the "next" element within the previous node, or to the "firstObserverPtr" if it is the diff --git a/src/corelib/kernel/qpropertyprivate.h b/src/corelib/kernel/qpropertyprivate.h index ab8c96b17f..d5ee9f29c2 100644 --- a/src/corelib/kernel/qpropertyprivate.h +++ b/src/corelib/kernel/qpropertyprivate.h @@ -96,13 +96,13 @@ public: void *propertyDataPtr, void *staticObserver = nullptr, QPropertyObserverCallback staticObserverCallback = nullptr, QPropertyGuardFunction guardCallback = nullptr); - QPropertyBindingPrivate *binding(); + QPropertyBindingPrivate *binding() const; - void evaluateIfDirty(); + void evaluateIfDirty() const; void removeBinding(); void registerWithCurrentlyEvaluatingBinding() const; - void notifyObservers(void *propertyDataPtr); + void notifyObservers(void *propertyDataPtr) const; void setExtraBit(bool b) { -- cgit v1.2.3