From e638e8a28d74af8129aaaf6b67fabbb5dbdf31e4 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 21 Aug 2020 12:56:11 +0200 Subject: Cleanups: Rename some classes Rename QPropertyBase to QPropertyBindingData, as it contains the data related to bindings. The new name fits better, as the data can now also live somewhere else than the data strored in the property. Change-Id: I489efb86ad2e0bad2740c9d1aa74506fe103d343 Reviewed-by: Ulf Hermann --- .../corelib/kernel/qproperty/tst_qproperty.cpp | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp index ebb8980d61..97c5a755db 100644 --- a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp +++ b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp @@ -108,30 +108,30 @@ void tst_QProperty::multipleDependencies() QProperty sum; sum = Qt::makePropertyBinding([&]() { return firstDependency + secondDependency; }); - QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 0); - QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 0); + QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 0); + QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 0); QCOMPARE(sum.value(), int(3)); - QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 1); - QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 1); firstDependency = 10; QCOMPARE(sum.value(), int(12)); - QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 1); - QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 1); secondDependency = 20; QCOMPARE(sum.value(), int(30)); - QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 1); - QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 1); firstDependency = 1; secondDependency = 1; QCOMPARE(sum.value(), int(2)); - QCOMPARE(QPropertyBasePointer::get(firstDependency).observerCount(), 1); - QCOMPARE(QPropertyBasePointer::get(secondDependency).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(firstDependency).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(secondDependency).observerCount(), 1); } void tst_QProperty::bindingWithDeletedDependency() @@ -190,13 +190,13 @@ void tst_QProperty::bindingAfterUse() propThatUsesFirstProp = Qt::makePropertyBinding(propWithBindingLater); QCOMPARE(propThatUsesFirstProp.value(), int(1)); - QCOMPARE(QPropertyBasePointer::get(propWithBindingLater).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(propWithBindingLater).observerCount(), 1); QProperty injectedValue(42); propWithBindingLater = Qt::makePropertyBinding(injectedValue); QCOMPARE(propThatUsesFirstProp.value(), int(42)); - QCOMPARE(QPropertyBasePointer::get(propWithBindingLater).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(propWithBindingLater).observerCount(), 1); } void tst_QProperty::switchBinding() @@ -227,12 +227,12 @@ void tst_QProperty::avoidDependencyAllocationAfterFirstEval() QCOMPARE(propWithBinding.value(), int(11)); - QVERIFY(QPropertyBasePointer::get(propWithBinding).bindingPtr()); - QCOMPARE(QPropertyBasePointer::get(propWithBinding).bindingPtr()->dependencyObserverCount, 2u); + QVERIFY(QPropertyBindingDataPointer::get(propWithBinding).bindingPtr()); + QCOMPARE(QPropertyBindingDataPointer::get(propWithBinding).bindingPtr()->dependencyObserverCount, 2u); firstDependency = 100; QCOMPARE(propWithBinding.value(), int(110)); - QCOMPARE(QPropertyBasePointer::get(propWithBinding).bindingPtr()->dependencyObserverCount, 2u); + QCOMPARE(QPropertyBindingDataPointer::get(propWithBinding).bindingPtr()->dependencyObserverCount, 2u); } void tst_QProperty::propertyArrays() @@ -348,18 +348,18 @@ void tst_QProperty::moveNotifies() QCOMPARE(finalProp1.value(), 1); QCOMPARE(finalProp2.value(), 1); - QCOMPARE(QPropertyBasePointer::get(propertyInTheMiddle).observerCount(), 2); + QCOMPARE(QPropertyBindingDataPointer::get(propertyInTheMiddle).observerCount(), 2); QProperty other = Qt::makePropertyBinding(second); QCOMPARE(other.value(), 2); QProperty otherDep = Qt::makePropertyBinding(other); QCOMPARE(otherDep.value(), 2); - QCOMPARE(QPropertyBasePointer::get(other).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(other).observerCount(), 1); propertyInTheMiddle = std::move(other); - QCOMPARE(QPropertyBasePointer::get(other).observerCount(), 0); + QCOMPARE(QPropertyBindingDataPointer::get(other).observerCount(), 0); QCOMPARE(finalProp1.value(), 2); QCOMPARE(finalProp2.value(), 2); @@ -371,11 +371,11 @@ void tst_QProperty::moveCtor() QProperty intermediate = Qt::makePropertyBinding(first); QCOMPARE(intermediate.value(), 1); - QCOMPARE(QPropertyBasePointer::get(first).observerCount(), 1); + QCOMPARE(QPropertyBindingDataPointer::get(first).observerCount(), 1); QProperty targetProp(std::move(first)); - QCOMPARE(QPropertyBasePointer::get(targetProp).observerCount(), 0); + QCOMPARE(QPropertyBindingDataPointer::get(targetProp).observerCount(), 0); } void tst_QProperty::changeHandler() -- cgit v1.2.3