summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-13 10:24:45 +0200
committerLars Knoll <lars.knoll@qt.io>2020-08-28 22:31:28 +0200
commit4294e82fe921105bfe137595394705f1c6b16904 (patch)
tree8fe0b2447c7a9e866cf4da00dd8c8da2b25142b4 /src
parent9d2b43de19eebc836683e00ca0516a59cb6abe5d (diff)
Add const to some methods
Change-Id: I60e93e0c9b57468ef4188bdb60a32fb9ac9046e1 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qproperty.cpp8
-rw-r--r--src/corelib/kernel/qproperty.h2
-rw-r--r--src/corelib/kernel/qpropertyprivate.h6
3 files changed, 8 insertions, 8 deletions
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<QPropertyObserver, ObserverTag> 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)
{