summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-21 13:00:02 +0200
committerLars Knoll <lars.knoll@qt.io>2020-09-02 22:44:27 +0200
commite6988d4d0bef2c3f474576250cb305a2f00a688b (patch)
tree9412573d07041918349dc2542673467739be73ce /tests/auto
parente638e8a28d74af8129aaaf6b67fabbb5dbdf31e4 (diff)
Remove QNotifiedProperty and Q_PRIVATE_QPROPERTY
And all related functionality. This is being replaced by Q_BINDABLE_PROPERTY and Q_OBJECT_BINDABLE_PROPERTY in the next few commits. The new infrastructure coming will play nicer along with the existing property system. Commented out some autotests, that will get reimplemented with the updated infrastructure. Change-Id: I50c30bd4d5c6c6b6471f8eb93870e27d86f5a009 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp303
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp196
2 files changed, 129 insertions, 370 deletions
diff --git a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
index 97c5a755db..97c4f5b752 100644
--- a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
+++ b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp
@@ -70,9 +70,6 @@ private slots:
void multipleObservers();
void propertyAlias();
void arrowAndStarOperator();
- void notifiedProperty();
- void notifiedPropertyWithOldValueCallback();
- void notifiedPropertyWithGuard();
void typeNoOperatorEqual();
void bindingValueReplacement();
};
@@ -780,240 +777,6 @@ void tst_QProperty::arrowAndStarOperator()
}
-struct ClassWithNotifiedProperty
-{
- QList<int> recordedValues;
-
- void callback() { recordedValues << property.value(); }
-
- QNotifiedProperty<int, &ClassWithNotifiedProperty::callback> property;
-};
-
-struct ClassWithNotifiedProperty2
-{
- QList<int> recordedValues;
-
- void callback(int oldValue) { recordedValues << oldValue; }
-
- QNotifiedProperty<int, &ClassWithNotifiedProperty2::callback> property;
-};
-
-void tst_QProperty::notifiedProperty()
-{
- ClassWithNotifiedProperty instance;
- std::array<QProperty<int>, 5> otherProperties = {
- QProperty<int>([&]() { return instance.property + 1; }),
- QProperty<int>([&]() { return instance.property + 2; }),
- QProperty<int>([&]() { return instance.property + 3; }),
- QProperty<int>([&]() { return instance.property + 4; }),
- QProperty<int>([&]() { return instance.property + 5; }),
- };
-
- auto check = [&] {
- const int val = instance.property.value();
- for (int i = 0; i < int(otherProperties.size()); ++i)
- QCOMPARE(otherProperties[i].value(), val + i + 1);
- };
-
- QVERIFY(instance.recordedValues.isEmpty());
- check();
-
- instance.property.setValue(&instance, 42);
- QCOMPARE(instance.recordedValues.count(), 1);
- QCOMPARE(instance.recordedValues.at(0), 42);
- instance.recordedValues.clear();
- check();
-
- instance.property.setValue(&instance, 42);
- QVERIFY(instance.recordedValues.isEmpty());
- check();
-
- int subscribedCount = 0;
- QProperty<int> injectedValue(100);
- instance.property.setBinding(&instance, [&injectedValue]() { return injectedValue.value(); });
- auto subscriber = [&] { ++subscribedCount; };
- std::array<QPropertyChangeHandler<decltype (subscriber)>, 10> subscribers = {
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber)
- };
-
- QCOMPARE(subscribedCount, 10);
- subscribedCount = 0;
-
- QCOMPARE(instance.property.value(), 100);
- QCOMPARE(instance.recordedValues.count(), 1);
- QCOMPARE(instance.recordedValues.at(0), 100);
- instance.recordedValues.clear();
- check();
- QCOMPARE(subscribedCount, 0);
-
- injectedValue = 200;
- QCOMPARE(instance.property.value(), 200);
- QCOMPARE(instance.recordedValues.count(), 1);
- QCOMPARE(instance.recordedValues.at(0), 200);
- instance.recordedValues.clear();
- check();
- QCOMPARE(subscribedCount, 10);
- subscribedCount = 0;
-
- injectedValue = 400;
- QCOMPARE(instance.property.value(), 400);
- QCOMPARE(instance.recordedValues.count(), 1);
- QCOMPARE(instance.recordedValues.at(0), 400);
- instance.recordedValues.clear();
- check();
- QCOMPARE(subscribedCount, 10);
-}
-
-void tst_QProperty::notifiedPropertyWithOldValueCallback()
-{
- ClassWithNotifiedProperty2 instance;
- instance.property.setValue(&instance, 1);
- instance.property.setBinding(&instance, [](){return 2;});
- instance.property.setBinding(&instance, [](){return 3;});
- instance.property.setValue(&instance, 4);
- QList<int> expected {0, 1, 2, 3};
- QCOMPARE(instance.recordedValues, expected);
- QCOMPARE(instance.property.value(), 4);
-}
-
-struct ClassWithNotifiedPropertyWithGuard
-{
- using This = ClassWithNotifiedPropertyWithGuard;
- QList<int> recordedValues;
-
- void callback() { recordedValues << property.value(); }
- void callback2() { recordedValues << property2.value(); }
- void callback3() {}
- bool trivialGuard(int ) {return true;}
- bool reject42(int newValue) {return newValue != 42;}
- bool bound(int &newValue) { newValue = qBound<int>(0, newValue, 100); return true; }
-
- QNotifiedProperty<int, &This::callback, &This::trivialGuard> property;
- QNotifiedProperty<int, &This::callback2, &This::reject42> property2;
- QNotifiedProperty<int, &This::callback3, &This::bound> property3;
-};
-
-void tst_QProperty::notifiedPropertyWithGuard()
-{
- {
- // property with guard that returns always true is the same as using no guard
- ClassWithNotifiedPropertyWithGuard instance;
-
- std::array<QProperty<int>, 5> otherProperties = {
- QProperty<int>([&]() { return instance.property + 1; }),
- QProperty<int>([&]() { return instance.property + 2; }),
- QProperty<int>([&]() { return instance.property + 3; }),
- QProperty<int>([&]() { return instance.property + 4; }),
- QProperty<int>([&]() { return instance.property + 5; }),
- };
-
- auto check = [&] {
- const int val = instance.property.value();
- for (int i = 0; i < int(otherProperties.size()); ++i)
- QCOMPARE(otherProperties[i].value(), val + i + 1);
- };
-
- QVERIFY(instance.recordedValues.isEmpty());
- check();
-
- instance.property.setValue(&instance, 42);
- QCOMPARE(instance.recordedValues.count(), 1);
- QCOMPARE(instance.recordedValues.at(0), 42);
- instance.recordedValues.clear();
- check();
-
- instance.property.setValue(&instance, 42);
- QVERIFY(instance.recordedValues.isEmpty());
- check();
-
- int subscribedCount = 0;
- QProperty<int> injectedValue(100);
- instance.property.setBinding(&instance, [&injectedValue]() { return injectedValue.value(); });
- auto subscriber = [&] { ++subscribedCount; };
- std::array<QPropertyChangeHandler<decltype (subscriber)>, 10> subscribers = {
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber),
- instance.property.subscribe(subscriber)
- };
-
- QCOMPARE(subscribedCount, 10);
- subscribedCount = 0;
-
- QCOMPARE(instance.property.value(), 100);
- QCOMPARE(instance.recordedValues.count(), 1);
- QCOMPARE(instance.recordedValues.at(0), 100);
- instance.recordedValues.clear();
- check();
- QCOMPARE(subscribedCount, 0);
-
- injectedValue = 200;
- QCOMPARE(instance.property.value(), 200);
- QCOMPARE(instance.recordedValues.count(), 1);
- QCOMPARE(instance.recordedValues.at(0), 200);
- instance.recordedValues.clear();
- check();
- QCOMPARE(subscribedCount, 10);
- subscribedCount = 0;
-
- injectedValue = 400;
- QCOMPARE(instance.property.value(), 400);
- QCOMPARE(instance.recordedValues.count(), 1);
- QCOMPARE(instance.recordedValues.at(0), 400);
- instance.recordedValues.clear();
- check();
- QCOMPARE(subscribedCount, 10);
- }
-
- {
- // Values can be rejected
- ClassWithNotifiedPropertyWithGuard instance2;
-
- instance2.property2.setValue(&instance2, 1);
- instance2.property2.setBinding(&instance2, [](){return 42;});
- instance2.property2.setValue(&instance2, 2);
- instance2.property2.setBinding(&instance2, [](){return 3;});
- instance2.property2.setValue(&instance2, 42);
- // Note that we get 1 twice
- // This is an unfortunate result of the lazyness used for bindings
- // When we call setBinding, the binding does not get evaluated, but we
- // call the callback in notify; the callback will in our case query the
- // properties' value. At that point we then evaluate the binding, and
- // notice that the value is in fact disallowed. Thus we return the old
- // value.
- QList<int> expected {1, 1, 2, 3};
- QCOMPARE(instance2.recordedValues, expected);
- }
-
- {
- // guard can modify incoming values
- ClassWithNotifiedPropertyWithGuard instance3;
- instance3.property3.setValue(&instance3, 5);
- int i1 = 5;
- QCOMPARE(instance3.property3.value(), i1);
- instance3.property3.setBinding(&instance3, [](){return 255;});
- QCOMPARE(instance3.property3.value(), 100);
- const int i2 = -1;
- instance3.property3.setValue(&instance3, i2);
- QCOMPARE(instance3.property3.value(), 0);
- }
-}
-
void tst_QProperty::typeNoOperatorEqual()
{
struct Uncomparable
@@ -1076,42 +839,42 @@ void tst_QProperty::typeNoOperatorEqual()
p1.setValue(u1);
QCOMPARE(p1.value().data, p3.value().data);
- QNotifiedProperty<Uncomparable, &Uncomparable::changed> np;
- QVERIFY(np.value().data != u1.data);
- np.setValue(&u1, u1);
- QVERIFY(u1.changedCalled);
- u1.changedCalled = false;
- QCOMPARE(np.value().data, u1.data);
- np.setValue(&u1, u1);
- QVERIFY(u1.changedCalled);
-}
-
-
-struct Test {
- void notify() {};
- bool bindText(int);
- bool bindIconText(int);
- QProperty<int> text;
- QNotifiedProperty<int, &Test::notify, &Test::bindIconText> iconText;
-};
-
-bool Test::bindIconText(int) {
- Q_UNUSED(iconText.value()); // force read
- if (!iconText.hasBinding()) {
- iconText.setBinding(this, [=]() { return 0; });
- }
- return true;
-}
+// QNotifiedProperty<Uncomparable, &Uncomparable::changed> np;
+// QVERIFY(np.value().data != u1.data);
+// np.setValue(&u1, u1);
+// QVERIFY(u1.changedCalled);
+// u1.changedCalled = false;
+// QCOMPARE(np.value().data, u1.data);
+// np.setValue(&u1, u1);
+// QVERIFY(u1.changedCalled);
+}
+
+
+//struct Test {
+// void notify() {};
+// bool bindText(int);
+// bool bindIconText(int);
+// QProperty<int> text;
+// QNotifiedProperty<int, &Test::notify, &Test::bindIconText> iconText;
+//};
+
+//bool Test::bindIconText(int) {
+// Q_UNUSED(iconText.value()); // force read
+// if (!iconText.hasBinding()) {
+// iconText.setBinding(this, [=]() { return 0; });
+// }
+// return true;
+//}
void tst_QProperty::bindingValueReplacement()
{
- Test test;
- test.text = 0;
- test.bindIconText(0);
- test.iconText.setValue(&test, 42); // should not crash
- QCOMPARE(test.iconText.value(), 42);
- test.text = 1;
- QCOMPARE(test.iconText.value(), 42);
+// Test test;
+// test.text = 0;
+// test.bindIconText(0);
+// test.iconText.setValue(&test, 42); // should not crash
+// QCOMPARE(test.iconText.value(), 42);
+// test.text = 1;
+// QCOMPARE(test.iconText.value(), 42);
}
QTEST_MAIN(tst_QProperty);
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index f0f8523f19..e17e2283fa 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -1543,7 +1543,6 @@ class PrivatePropertyTest : public QObject
Q_PRIVATE_PROPERTY(PrivatePropertyTest::d, QString blub4 MEMBER mBlub NOTIFY blub4Changed)
Q_PRIVATE_PROPERTY(PrivatePropertyTest::d, QString blub5 MEMBER mBlub NOTIFY blub5Changed)
Q_PRIVATE_PROPERTY(PrivatePropertyTest::d, QString blub6 MEMBER mConst CONSTANT)
- Q_PRIVATE_PROPERTY(PrivatePropertyTest::d, QProperty<int> x)
class MyDPointer {
public:
MyDPointer() : mConst("const"), mBar(0), mPlop(0) {}
@@ -1557,7 +1556,6 @@ class PrivatePropertyTest : public QObject
void setBlub(const QString &value) { mBlub = value; }
QString mBlub;
const QString mConst;
- QProperty<int> x;
private:
int mBar;
int mPlop;
@@ -1568,6 +1566,7 @@ public:
int foo() { return mFoo ; }
void setFoo(int value) { mFoo = value; }
MyDPointer *d_func() {return d.data();}
+ const MyDPointer *d_func() const {return d.data();}
signals:
void blub4Changed();
void blub5Changed(const QString &newBlub);
@@ -1592,10 +1591,6 @@ void tst_Moc::qprivateproperties()
test.setProperty("baz", 4);
QCOMPARE(test.property("baz"), QVariant::fromValue(4));
-
- test.setProperty("x", 100);
- QCOMPARE(test.property("x"), QVariant::fromValue(100));
- QVERIFY(test.metaObject()->property(test.metaObject()->indexOfProperty("x")).isQProperty());
}
void tst_Moc::warnOnPropertyWithoutREAD()
@@ -4084,7 +4079,7 @@ signals:
void publicPropertyChanged();
public:
- QNotifiedProperty<int, &ClassWithQPropertyMembers::publicPropertyChanged> publicProperty;
+// QNotifiedProperty<int, &ClassWithQPropertyMembers::publicPropertyChanged> publicProperty;
QProperty<int> notExposed;
@@ -4098,87 +4093,88 @@ private:
void tst_Moc::qpropertyMembers()
{
- const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject;
+// const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject;
- QCOMPARE(metaObject->propertyCount() - metaObject->superClass()->propertyCount(), 2);
+// QCOMPARE(metaObject->propertyCount() - metaObject->superClass()->propertyCount(), 2);
- QCOMPARE(metaObject->indexOfProperty("notExposed"), -1);
+// QCOMPARE(metaObject->indexOfProperty("notExposed"), -1);
- QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty"));
- QVERIFY(prop.isValid());
+// QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty"));
+// QVERIFY(prop.isValid());
- QVERIFY(metaObject->property(metaObject->indexOfProperty("privateExposedProperty")).isValid());
+// QVERIFY(metaObject->property(metaObject->indexOfProperty("privateExposedProperty")).isValid());
- ClassWithQPropertyMembers instance;
+// ClassWithQPropertyMembers instance;
- prop.write(&instance, 42);
- QCOMPARE(instance.publicProperty.value(), 42);
+// prop.write(&instance, 42);
+// QCOMPARE(instance.publicProperty.value(), 42);
- QSignalSpy publicPropertySpy(&instance, SIGNAL(publicPropertyChanged()));
+// QSignalSpy publicPropertySpy(&instance, SIGNAL(publicPropertyChanged()));
- instance.publicProperty.setValue(&instance, 100);
- QCOMPARE(prop.read(&instance).toInt(), 100);
- QCOMPARE(publicPropertySpy.count(), 1);
+// instance.publicProperty.setValue(&instance, 100);
+// QCOMPARE(prop.read(&instance).toInt(), 100);
+// QCOMPARE(publicPropertySpy.count(), 1);
- QCOMPARE(prop.metaType(), QMetaType(QMetaType::Int));
+// QCOMPARE(prop.metaType(), QMetaType(QMetaType::Int));
- QVERIFY(prop.notifySignal().isValid());
+// QVERIFY(prop.notifySignal().isValid());
}
void tst_Moc::observerMetaCall()
{
- const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject;
- QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty"));
- QVERIFY(prop.isValid());
+// const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject;
+// QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty"));
+// QVERIFY(prop.isValid());
- ClassWithQPropertyMembers instance;
+// ClassWithQPropertyMembers instance;
- int observerCallCount = 0;
+// int observerCallCount = 0;
- QProperty<int> dummy;
- auto handler = dummy.onValueChanged([&observerCallCount]() {
- ++observerCallCount;
- });
- {
- void *argv[] = { &handler };
- instance.qt_metacall(QMetaObject::RegisterQPropertyObserver, prop.propertyIndex(), argv);
- }
+// auto handler = QPropertyChangeHandler([&observerCallCount]() {
+// ++observerCallCount;
+// });
- instance.publicProperty.setValue(&instance, 100);
- QCOMPARE(observerCallCount, 1);
- instance.publicProperty.setValue(&instance, 101);
- QCOMPARE(observerCallCount, 2);
+// {
+// void *argv[] = { &handler };
+// instance.qt_metacall(QMetaObject::RegisterQPropertyObserver, prop.propertyIndex(), argv);
+// }
+
+// QCOMPARE(observerCallCount, 0);
+// instance.publicProperty.setValue(100);
+// QCOMPARE(observerCallCount, 1);
+// instance.publicProperty.setValue(&instance, 101);
+// QCOMPARE(observerCallCount, 2);
}
void tst_Moc::setQPRopertyBinding()
{
- const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject;
- QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty"));
- QVERIFY(prop.isValid());
+// const auto metaObject = &ClassWithQPropertyMembers::staticMetaObject;
+// QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("publicProperty"));
+// QVERIFY(prop.isValid());
- ClassWithQPropertyMembers instance;
+// ClassWithQPropertyMembers instance;
- bool bindingCalled = false;
- auto binding = Qt::makePropertyBinding([&bindingCalled]() {
- bindingCalled = true;
- return 42;
- });
+// bool bindingCalled = false;
+// auto binding = Qt::makePropertyBinding([&bindingCalled]() {
+// bindingCalled = true;
+// return 42;
+// });
- {
- void *argv[] = { &binding };
- instance.qt_metacall(QMetaObject::SetQPropertyBinding, prop.propertyIndex(), argv);
- }
+// {
+// void *argv[] = { &binding };
+// instance.qt_metacall(QMetaObject::SetQPropertyBinding, prop.propertyIndex(), argv);
+// }
- QCOMPARE(instance.publicProperty.value(), 42);
- QVERIFY(bindingCalled); // but now it should've been called :)
+// QCOMPARE(instance.publicProperty.value(), 42);
+// QVERIFY(bindingCalled); // but now it should've been called :)
}
-
+#if 0
class ClassWithPrivateQPropertyShim :public QObject
{
Q_OBJECT
@@ -4231,54 +4227,54 @@ public:
Private *d_func() { return &priv; }
const Private *d_func() const { return &priv; }
};
-
+#endif
void tst_Moc::privateQPropertyShim()
{
- ClassWithPrivateQPropertyShim testObject;
-
- {
- auto metaObject = &ClassWithPrivateQPropertyShim::staticMetaObject;
- QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("testProperty"));
- QVERIFY(prop.isValid());
- QVERIFY(prop.notifySignal().isValid());
- }
-
- testObject.priv.testProperty.setValue(&testObject.priv, 42);
- QCOMPARE(testObject.property("testProperty").toInt(), 42);
-
- // Behave like a QProperty
- QVERIFY(!testObject.testProperty.hasBinding());
- testObject.testProperty.setBinding([]() { return 100; });
- QCOMPARE(testObject.testProperty.value(), 100);
- QVERIFY(testObject.testProperty.hasBinding());
-
- // Old style setter getters
- testObject.setTestProperty(400);
- QVERIFY(!testObject.testProperty.hasBinding());
- QCOMPARE(testObject.testProperty(), 400);
-
- // Created and default-initialized, without nullptr access
- QCOMPARE(testObject.lazyTestProperty(), 0);
-
- // Explicitly set to something
- testObject.priv.lazyTestProperty()->setValue(&testObject.priv, 42);
- QCOMPARE(testObject.property("lazyTestProperty").toInt(), 42);
-
- // Behave like a QProperty
- QVERIFY(!testObject.lazyTestProperty.hasBinding());
- testObject.lazyTestProperty.setBinding([]() { return 100; });
- QCOMPARE(testObject.lazyTestProperty.value(), 100);
- QVERIFY(testObject.lazyTestProperty.hasBinding());
-
- // Old style setter getters
- testObject.setLazyTestProperty(400);
- QVERIFY(!testObject.lazyTestProperty.hasBinding());
- QCOMPARE(testObject.lazyTestProperty(), 400);
-
- // mo generates correct code for plain QProperty in PIMPL
- testObject.testProperty2.setValue(42);
- QCOMPARE(testObject.testProperty2.value(), 42);
+// ClassWithPrivateQPropertyShim testObject;
+
+// {
+// auto metaObject = &ClassWithPrivateQPropertyShim::staticMetaObject;
+// QMetaProperty prop = metaObject->property(metaObject->indexOfProperty("testProperty"));
+// QVERIFY(prop.isValid());
+// QVERIFY(prop.notifySignal().isValid());
+// }
+
+// testObject.priv.testProperty.setValue(&testObject.priv, 42);
+// QCOMPARE(testObject.property("testProperty").toInt(), 42);
+
+// // Behave like a QProperty
+// QVERIFY(!testObject.testProperty.hasBinding());
+// testObject.testProperty.setBinding([]() { return 100; });
+// QCOMPARE(testObject.testProperty.value(), 100);
+// QVERIFY(testObject.testProperty.hasBinding());
+
+// // Old style setter getters
+// testObject.setTestProperty(400);
+// QVERIFY(!testObject.testProperty.hasBinding());
+// QCOMPARE(testObject.testProperty(), 400);
+
+// // Created and default-initialized, without nullptr access
+// QCOMPARE(testObject.lazyTestProperty(), 0);
+
+// // Explicitly set to something
+// testObject.priv.lazyTestProperty()->setValue(&testObject.priv, 42);
+// QCOMPARE(testObject.property("lazyTestProperty").toInt(), 42);
+
+// // Behave like a QProperty
+// QVERIFY(!testObject.lazyTestProperty.hasBinding());
+// testObject.lazyTestProperty.setBinding([]() { return 100; });
+// QCOMPARE(testObject.lazyTestProperty.value(), 100);
+// QVERIFY(testObject.lazyTestProperty.hasBinding());
+
+// // Old style setter getters
+// testObject.setLazyTestProperty(400);
+// QVERIFY(!testObject.lazyTestProperty.hasBinding());
+// QCOMPARE(testObject.lazyTestProperty(), 400);
+
+// // mo generates correct code for plain QProperty in PIMPL
+// testObject.testProperty2.setValue(42);
+// QCOMPARE(testObject.testProperty2.value(), 42);
}
QTEST_MAIN(tst_Moc)