diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-02-27 14:11:51 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-03-19 13:09:13 +0100 |
commit | 4a702e580eec2d6efc4f80664725bd90bfcaa4e0 (patch) | |
tree | 2c67ac949d55238d4260002f543f5aa349742435 /src/corelib/kernel/qproperty_p.h | |
parent | 58992993a381fedd2f0e36edb73a63cfb9b3bcea (diff) |
Use QTaggedPointer in QPropertyObserver
This replaces the private tagged pointer and the use of enums for the
tag makes the observer handling code more readable. The
pointer-to-tagged-pointer class remains in qpropertyprivate.h due to its
exoticness.
Change-Id: Icc88799136c6839426d994b42368526463265e66
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qproperty_p.h')
-rw-r--r-- | src/corelib/kernel/qproperty_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index 1b96e09d58..8815e66b69 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -65,7 +65,8 @@ struct Q_AUTOTEST_EXPORT QPropertyBasePointer QPropertyBindingPrivate *bindingPtr() const; - QtPrivate::QPropertyTagPreservingPointerToPointer<QPropertyObserver> firstObserverPtr() const; + void addObserver(QPropertyObserver *observer); + void setFirstObserver(QPropertyObserver *observer); QPropertyObserverPointer firstObserver() const; int observerCount() const; @@ -93,7 +94,7 @@ struct QPropertyObserverPointer explicit operator bool() const { return ptr != nullptr; } - QPropertyObserverPointer nextObserver() const { return {ptr->next.data()}; } + QPropertyObserverPointer nextObserver() const { return {ptr->next.pointer()}; } }; class QPropertyBindingErrorPrivate : public QSharedData |