diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-20 10:13:49 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-24 19:45:59 +0200 |
commit | c2cf5f824a09adf0362f015c1b9d1817dabb04c3 (patch) | |
tree | 54cb2e3bf0bc02d86ccf8f0e8286daaf7092fe59 /src/corelib/kernel/qproperty_p.h | |
parent | c4245e7b8ceb233a06cea1ace9439795738adbf8 (diff) |
Whitespace cleanup in corelib/kernel
Change-Id: If061ef0af5ced4384e20a82afcea3712fa7e45d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/kernel/qproperty_p.h')
-rw-r--r-- | src/corelib/kernel/qproperty_p.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index e9a7a7f198..fdb5f14ccd 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -226,7 +226,8 @@ public: staticObserverCallback = nullptr; } } - void prependObserver(QPropertyObserverPointer observer) { + void prependObserver(QPropertyObserverPointer observer) + { observer.ptr->prev = const_cast<QPropertyObserver **>(&firstObserver.ptr); firstObserver = observer; } @@ -254,7 +255,8 @@ public: heapObservers->clear(); dependencyObserverCount = 0; } - QPropertyObserverPointer allocateDependencyObserver() { + QPropertyObserverPointer allocateDependencyObserver() + { if (dependencyObserverCount < inlineDependencyObservers.size()) { ++dependencyObserverCount; return {&inlineDependencyObservers[dependencyObserverCount - 1]}; @@ -280,7 +282,8 @@ public: void setError(QPropertyBindingError &&e) { error = std::move(e); } - void detachFromProperty() { + void detachFromProperty() + { hasStaticObserver = false; hasBindingWrapper = false; propertyDataPtr = nullptr; @@ -309,17 +312,17 @@ inline void QPropertyBindingDataPointer::fixupFirstObserverAfterMove() const if (ptr->d_ptr & QtPrivate::QPropertyBindingData::BindingBit) return; // nothing to do if the observer is stored in the binding if (auto observer = firstObserver()) - observer.ptr->prev = reinterpret_cast<QPropertyObserver**>(&(ptr->d_ptr)); + observer.ptr->prev = reinterpret_cast<QPropertyObserver **>(&(ptr->d_ptr)); } inline QPropertyObserverPointer QPropertyBindingDataPointer::firstObserver() const { if (auto *binding = bindingPtr()) return binding->firstObserver; - return {reinterpret_cast<QPropertyObserver*>(ptr->d_ptr & ~QtPrivate::QPropertyBindingData::FlagMask)}; + return { reinterpret_cast<QPropertyObserver *>(ptr->d_ptr + & ~QtPrivate::QPropertyBindingData::FlagMask) }; } - template<typename Class, typename T, auto Offset, auto Setter> class QObjectCompatProperty : public QPropertyData<T> { @@ -363,7 +366,8 @@ public: explicit QObjectCompatProperty(const T &initialValue) : QPropertyData<T>(initialValue) {} explicit QObjectCompatProperty(T &&initialValue) : QPropertyData<T>(std::move(initialValue)) {} - parameter_type value() const { + parameter_type value() const + { const QBindingStorage *storage = qGetBindingStorage(owner()); // make sure we don't register this binding as a dependency to itself if (!inBindingWrapper(storage)) @@ -393,7 +397,8 @@ public: return value(); } - void setValue(parameter_type t) { + void setValue(parameter_type t) + { QBindingStorage *storage = qGetBindingStorage(owner()); auto *bd = storage->bindingData(this); // make sure we don't remove the binding if called from the bindingWrapper |