diff options
author | Debao Zhang <dbzhang800@gmail.com> | 2012-04-29 00:11:28 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-02 08:30:59 +0200 |
commit | ade888860334d207f5f070b0bc9c4c98deaf3862 (patch) | |
tree | 133a3bde54e8ef5fa8857814a45cc5000ee5b287 /tests/auto/tools | |
parent | 6102ab8d646d76a68bb460885394501e90b4fd1f (diff) |
Don't use obsolete qVariantValue, qVariantCanConvert, etc.
qVariantValue and qVariantCanConvert are Compatibility members, while in
Qt4.8 they are marked as Qt 3 Support Members.
qVariantFromValue and qVariantSetValue are Obsolete members.
Change-Id: Ie8505cad1e0950e40c6f6710fde9f6fb2ac670fd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/tools')
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index b354e0a82a..1bf016d6f5 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -860,13 +860,13 @@ void tst_Moc::namespaceTypeProperty() QByteArray ba = QByteArray("points"); QVariant v = tst.property(ba); QVERIFY(v.isValid()); - myNS::Points p = qVariantValue<myNS::Points>(v); + myNS::Points p = qvariant_cast<myNS::Points>(v); QCOMPARE(p.p1, 0xBEEF); QCOMPARE(p.p2, 0xBABE); p.p1 = 0xCAFE; p.p2 = 0x1EE7; - QVERIFY(tst.setProperty(ba, qVariantFromValue(p))); - myNS::Points pp = qVariantValue<myNS::Points>(tst.property(ba)); + QVERIFY(tst.setProperty(ba, QVariant::fromValue(p))); + myNS::Points pp = qvariant_cast<myNS::Points>(tst.property(ba)); QCOMPARE(p.p1, pp.p1); QCOMPARE(p.p2, pp.p2); } @@ -1181,16 +1181,16 @@ void tst_Moc::qprivateproperties() PrivatePropertyTest test; test.setProperty("foo", 1); - QCOMPARE(test.property("foo"), qVariantFromValue(1)); + QCOMPARE(test.property("foo"), QVariant::fromValue(1)); test.setProperty("bar", 2); - QCOMPARE(test.property("bar"), qVariantFromValue(2)); + QCOMPARE(test.property("bar"), QVariant::fromValue(2)); test.setProperty("plop", 3); - QCOMPARE(test.property("plop"), qVariantFromValue(3)); + QCOMPARE(test.property("plop"), QVariant::fromValue(3)); test.setProperty("baz", 4); - QCOMPARE(test.property("baz"), qVariantFromValue(4)); + QCOMPARE(test.property("baz"), QVariant::fromValue(4)); } |