diff options
author | Chris Adams <christopher.adams@nokia.com> | 2012-07-16 16:32:49 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-09 07:58:06 +0200 |
commit | 42f9444e983b5257241c17242471ca63f208c3f6 (patch) | |
tree | 4847ae743a0e05b0ff9d3d4ab6003ea257a6c682 /tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | |
parent | f09517bd9c907698a05ee92ccf158a06db3340b8 (diff) |
Allow invokable functions of value-type classes to be called
Previously, invokable functions of value-type classes were returned as
properties. This commit fixes that bug by allowing such functions to
be invoked normally. It also improves copy-value type handling.
This commit also ensures that QMatrix4x4 value types are constructed
with qreal values as this is the storage type used internally.
Change-Id: Iab0fe4c522ed53d60154e8a8d46dda925fb9f4de
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp')
-rw-r--r-- | tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index a323db5d5f..cf8eb34fd6 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -303,8 +303,6 @@ void tst_qqmlvaluetypes::variant() } { - QString w1 = testFileUrl("variant_write.1.qml").toString() + QLatin1String(":9: TypeError: Object QVector2D(8, 2) has no method 'plus'"); - QTest::ignoreMessage(QtWarningMsg, qPrintable(w1)); QQmlComponent component(&engine, testFileUrl("variant_write.1.qml")); QObject *object = component.create(); QVERIFY(object != 0); @@ -502,6 +500,14 @@ void tst_qqmlvaluetypes::vector2d() delete object; } + + { + QQmlComponent component(&engine, testFileUrl("vector2d_invokables.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + QVERIFY(object->property("success").toBool()); + delete object; + } } void tst_qqmlvaluetypes::vector3d() @@ -547,6 +553,14 @@ void tst_qqmlvaluetypes::vector3d() delete object; } + + { + QQmlComponent component(&engine, testFileUrl("vector3d_invokables.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + QVERIFY(object->property("success").toBool()); + delete object; + } } void tst_qqmlvaluetypes::vector4d() @@ -592,6 +606,14 @@ void tst_qqmlvaluetypes::vector4d() delete object; } + + { + QQmlComponent component(&engine, testFileUrl("vector4d_invokables.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + QVERIFY(object->property("success").toBool()); + delete object; + } } void tst_qqmlvaluetypes::quaternion() @@ -701,6 +723,14 @@ void tst_qqmlvaluetypes::matrix4x4() delete object; } + + { + QQmlComponent component(&engine, testFileUrl("matrix4x4_invokables.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(object->property("success").toBool(), true); + delete object; + } } void tst_qqmlvaluetypes::font() |