diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-06-14 10:18:45 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-21 04:13:17 +0200 |
commit | 09b605ddcc33575316211156ff5979aa92e7e1fd (patch) | |
tree | 61141ac9323983a1ddbbad7602db0687b8d11a5c /tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | |
parent | 58f3f50c43f021ebfe214062562498d02b6f2071 (diff) |
Enable literal Qt enum assignment to enum properties.
Assigning Qt global enums to enum properties was previously handled as
a binding, rather than a literal assignment.
Change-Id: If6bb65f63b34f4e10c0636221ddadb11f7025735
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index c6b0dd66cc..e32489635b 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -579,6 +579,8 @@ void tst_qqmllanguage::assignBasicTypes() QVERIFY(object != 0); QCOMPARE(object->flagProperty(), MyTypeObject::FlagVal1 | MyTypeObject::FlagVal3); QCOMPARE(object->enumProperty(), MyTypeObject::EnumVal2); + QCOMPARE(object->qtEnumProperty(), Qt::RichText); + QCOMPARE(object->mirroredEnumProperty(), MyTypeObject::MirroredEnumVal3); QCOMPARE(object->stringProperty(), QString("Hello World!")); QCOMPARE(object->uintProperty(), uint(10)); QCOMPARE(object->intProperty(), -19); @@ -606,6 +608,10 @@ void tst_qqmllanguage::assignBasicTypes() MyTypeObject *child = qobject_cast<MyTypeObject *>(object->objectProperty()); QVERIFY(child != 0); QCOMPARE(child->intProperty(), 8); + + //these used to go via script. Ensure they no longer do + QCOMPARE(object->property("qtEnumTriggeredChange").toBool(), false); + QCOMPARE(object->property("mirroredEnumTriggeredChange").toBool(), false); } // Test edge case type assignments |