From de70798859e0363c8ca3133a4ed1a1092cfe47f5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 6 Oct 2015 10:14:26 +0200 Subject: QMetaProperty::write should reset the property if an empty QVariant is given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ChangeLog][QtCore][QMetaProperty] write() now resets the property if an empty QVariant is given, or set a default constructed object if the property is not resettable Change-Id: I9f9b57114e740f03ec4db6f223c1e8280a3d5209 Reviewed-by: Jędrzej Nowacki Reviewed-by: Oswald Buddenhagen --- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/corelib/kernel/qobject') diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 4617ce5e74..a3c6d8e9df 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -1925,7 +1925,7 @@ void tst_QObject::property() QCOMPARE(object.property("string"), QVariant("String1")); QVERIFY(object.setProperty("string", "String2")); QCOMPARE(object.property("string"), QVariant("String2")); - QVERIFY(!object.setProperty("string", QVariant())); + QVERIFY(object.setProperty("string", QVariant())); const int idx = mo->indexOfProperty("variant"); QVERIFY(idx != -1); @@ -2027,7 +2027,7 @@ void tst_QObject::property() QCOMPARE(object.property("customString"), QVariant("String1")); QVERIFY(object.setProperty("customString", "String2")); QCOMPARE(object.property("customString"), QVariant("String2")); - QVERIFY(!object.setProperty("customString", QVariant())); + QVERIFY(object.setProperty("customString", QVariant())); } void tst_QObject::metamethod() -- cgit v1.2.3