diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-10-12 22:43:14 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-10-12 22:43:14 (GMT) |
commit | 199845126df4b4ab0b8bf329bb104a7e3b2404bf (patch) | |
tree | 5e3768002f2ff668a515404f6ecfe7c9a13bb87d /tests/auto | |
parent | 231604bc063c002240479b69baa8110c2c83e9e1 (diff) | |
parent | 65dfb60a64d31baa555e6c52ccf3aad4309a9db3 (diff) | |
download | Qt-199845126df4b4ab0b8bf329bb104a7e3b2404bf.zip Qt-199845126df4b4ab0b8bf329bb104a7e3b2404bf.tar.gz Qt-199845126df4b4ab0b8bf329bb104a7e3b2404bf.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto')
15 files changed, 114 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmllanguage/data/ComponentComposite.qml b/tests/auto/declarative/qmllanguage/data/ComponentComposite.qml new file mode 100644 index 0000000..f8726ef --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/ComponentComposite.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +Component { + Object {} +} diff --git a/tests/auto/declarative/qmllanguage/data/CompositeType.qml b/tests/auto/declarative/qmllanguage/data/CompositeType.qml new file mode 100644 index 0000000..8c5094b --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/CompositeType.qml @@ -0,0 +1,4 @@ +import Qt 4.6 + +Object { +} diff --git a/tests/auto/declarative/qmllanguage/data/CompositeType2.qml b/tests/auto/declarative/qmllanguage/data/CompositeType2.qml new file mode 100644 index 0000000..86210e9 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/CompositeType2.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyQmlObject { +} + diff --git a/tests/auto/declarative/qmllanguage/data/CompositeType3.qml b/tests/auto/declarative/qmllanguage/data/CompositeType3.qml new file mode 100644 index 0000000..bb5469a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/CompositeType3.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +Object { + property int a +} diff --git a/tests/auto/declarative/qmllanguage/data/CompositeType4.qml b/tests/auto/declarative/qmllanguage/data/CompositeType4.qml new file mode 100644 index 0000000..a6a8168 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/CompositeType4.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyQmlObject { + property int a +} + diff --git a/tests/auto/declarative/qmllanguage/data/I18n.qml b/tests/auto/declarative/qmllanguage/data/I18n.qml new file mode 100644 index 0000000..dbbd4bd --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/I18n.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Text { + property int áâãäå: 10 + text: "Test áâãäå: " + áâãäå +} diff --git a/tests/auto/declarative/qmllanguage/data/I18nÁâãäå.qml b/tests/auto/declarative/qmllanguage/data/I18nÁâãäå.qml new file mode 100644 index 0000000..6a841d1 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/I18nÁâãäå.qml @@ -0,0 +1,4 @@ +import Qt 4.6 + +Text { +} diff --git a/tests/auto/declarative/qmllanguage/data/assignCompositeToType.qml b/tests/auto/declarative/qmllanguage/data/assignCompositeToType.qml new file mode 100644 index 0000000..ec2867d --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/assignCompositeToType.qml @@ -0,0 +1,18 @@ +import Qt 4.6 +import Test 1.0 + +Object { + property Object myProperty + property Object myProperty2 + property Object myProperty3 + property Object myProperty4 + property MyQmlObject myProperty5 + property MyQmlObject myProperty6 + + myProperty: CompositeType {} + myProperty2: CompositeType2 {} + myProperty3: CompositeType3 {} + myProperty4: CompositeType4 {} + myProperty5: CompositeType2 {} + myProperty6: CompositeType4 {} +} diff --git a/tests/auto/declarative/qmllanguage/data/componentCompositeType.qml b/tests/auto/declarative/qmllanguage/data/componentCompositeType.qml new file mode 100644 index 0000000..3a1b191 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/componentCompositeType.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Object { + property var test + + test: ComponentComposite {} +} + diff --git a/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyNames.qml b/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyNames.qml new file mode 100644 index 0000000..dbbd4bd --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyNames.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Text { + property int áâãäå: 10 + text: "Test áâãäå: " + áâãäå +} diff --git a/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyUse.qml b/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyUse.qml new file mode 100644 index 0000000..240d7c1 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyUse.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +I18n { + áâãäå: 15 +} diff --git a/tests/auto/declarative/qmllanguage/data/i18nScript.qml b/tests/auto/declarative/qmllanguage/data/i18nScript.qml new file mode 100644 index 0000000..6d07b03 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/i18nScript.qml @@ -0,0 +1,12 @@ +import Qt 4.6 + +Text { + Script { + function val() { + var áâãäå = 10 + return "Test áâãäå: " + áâãäå + } + + } + text: val() +} diff --git a/tests/auto/declarative/qmllanguage/data/i18nStrings.qml b/tests/auto/declarative/qmllanguage/data/i18nStrings.qml new file mode 100644 index 0000000..062191f --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/i18nStrings.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +Text { + text: "Test áâãäå (5 accented 'a' letters)" +} diff --git a/tests/auto/declarative/qmllanguage/data/i18nType.qml b/tests/auto/declarative/qmllanguage/data/i18nType.qml new file mode 100644 index 0000000..1a73096 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/i18nType.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +I18nÁâãäå { + text: "TEST" +} diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index ff78e6d..a991144 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -39,6 +39,7 @@ private slots: void assignQmlComponent(); void assignBasicTypes(); void assignTypeExtremes(); + void assignCompositeToType(); void customParserTypes(); void rootAsQmlComponent(); void inlineQmlComponents(); @@ -56,6 +57,7 @@ private slots: void valueTypes(); void cppnamespace(); void aliasProperties(); + void componentCompositeType(); void importsBuiltin_data(); void importsBuiltin(); @@ -323,6 +325,15 @@ void tst_qmllanguage::assignTypeExtremes() QCOMPARE(object->intProperty(), -0x77359400); } +// Test that a composite type can assign to a property of its base type +void tst_qmllanguage::assignCompositeToType() +{ + QmlComponent component(&engine, TEST_FILE("assignCompositeToType.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); +} + // Tests that custom parser types can be instantiated void tst_qmllanguage::customParserTypes() { @@ -647,6 +658,15 @@ void tst_qmllanguage::aliasProperties() } } +// Test that the root element in a composite type can be a Component +void tst_qmllanguage::componentCompositeType() +{ + QmlComponent component(&engine, TEST_FILE("componentCompositeType.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); +} + class TestType : public QObject { Q_OBJECT public: |