diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index f8299b5d29..b57ba7851a 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -608,13 +608,6 @@ QPropertyBindingData::NotificationResult QPropertyBindingData::notifyObserver_he return Evaluated; } -int QPropertyBindingDataPointer::observerCount() const -{ - int count = 0; - for (auto observer = firstObserver(); observer; observer = observer.nextObserver()) - ++count; - return count; -} QPropertyObserver::QPropertyObserver(ChangeHandler changeHandler) { diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index cafe211e71..5105fd6343 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -68,7 +68,7 @@ namespace QtPrivate { // we need to allow the compiler to inline where it makes sense. // This is a helper "namespace" -struct Q_AUTOTEST_EXPORT QPropertyBindingDataPointer +struct QPropertyBindingDataPointer { const QtPrivate::QPropertyBindingData *ptr = nullptr; @@ -85,10 +85,10 @@ struct Q_AUTOTEST_EXPORT QPropertyBindingDataPointer } static void fixupAfterMove(QtPrivate::QPropertyBindingData *ptr); void Q_ALWAYS_INLINE addObserver(QPropertyObserver *observer); - void setFirstObserver(QPropertyObserver *observer); - QPropertyObserverPointer firstObserver() const; + inline void setFirstObserver(QPropertyObserver *observer); + inline QPropertyObserverPointer firstObserver() const; - int observerCount() const; + inline int observerCount() const; template static QPropertyBindingDataPointer get(QProperty &property) @@ -442,6 +442,14 @@ inline QPropertyObserverPointer QPropertyBindingDataPointer::firstObserver() con return { reinterpret_cast(ptr->d()) }; } +inline int QPropertyBindingDataPointer::observerCount() const +{ + int count = 0; + for (auto observer = firstObserver(); observer; observer = observer.nextObserver()) + ++count; + return count; +} + namespace QtPrivate { Q_CORE_EXPORT bool isPropertyInBindingWrapper(const QUntypedPropertyData *property); void Q_CORE_EXPORT initBindingStatusThreadId();