diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-02-24 02:42:00 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-02-24 02:42:00 (GMT) |
commit | 7c76abb0dc4204043bec9b6fa315f9753a7986ae (patch) | |
tree | cee303672cfd138790645e731f2d69472564d4b7 /tests/auto/declarative/qdeclarativexmllistmodel/data | |
parent | 4066e60e859853cfe3240245ba05271e79839506 (diff) | |
download | Qt-7c76abb0dc4204043bec9b6fa315f9753a7986ae.zip Qt-7c76abb0dc4204043bec9b6fa315f9753a7986ae.tar.gz Qt-7c76abb0dc4204043bec9b6fa315f9753a7986ae.tar.bz2 |
Change class prefix to from QmlXXX to QDeclarativeXXX, QmlGraphicsXXX to QDeclarativeXXX.
Diffstat (limited to 'tests/auto/declarative/qdeclarativexmllistmodel/data')
8 files changed, 206 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml new file mode 100644 index 0000000..2cbb027 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +XmlListModel { + source: "model.xml" + query: "/Pets/Pet" + XmlRole { name: "name"; query: "name/string()" } + XmlRole { name: "type"; query: "type/string()" } + XmlRole { name: "age"; query: "age/number()" } + XmlRole { name: "size"; query: "size/string()" } +} diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model.xml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.xml new file mode 100644 index 0000000..40cd6d0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.xml @@ -0,0 +1,54 @@ +<Pets> + <Pet> + <name>Polly</name> + <type>Parrot</type> + <age>12</age> + <size>Small</size> + </Pet> + <Pet> + <name>Penny</name> + <type>Turtle</type> + <age>4</age> + <size>Small</size> + </Pet> + <Pet> + <name>Warren</name> + <type>Rabbit</type> + <age>2</age> + <size>Small</size> + </Pet> + <Pet> + <name>Spot</name> + <type>Dog</type> + <age>9</age> + <size>Medium</size> + </Pet> + <Pet> + <name>Whiskers</name> + <type>Cat</type> + <age>2</age> + <size>Medium</size> + </Pet> + <Pet> + <name>Joey</name> + <type>Kangaroo</type> + <age>1</age> + </Pet> + <Pet> + <name>Kimba</name> + <type>Bunny</type> + <age>65</age> + <size>Large</size> + </Pet> + <Pet> + <name>Rover</name> + <type>Dog</type> + <size>Large</size> + </Pet> + <Pet> + <name>Tiny</name> + <type>Elephant</type> + <age>15</age> + <size>Large</size> + </Pet> +</Pets> diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml new file mode 100644 index 0000000..140e0ad --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml @@ -0,0 +1,11 @@ +import Qt 4.6 + +XmlListModel { + source: "model.xml" + query: "/Pets/Pet" + XmlRole { name: "name"; query: "name/string()" } + XmlRole { name: "type"; query: "type/string()" } + XmlRole { name: "age"; query: "age/number()" } + XmlRole { name: "size"; query: "size/string()" } + XmlRole { name: "tricks"; query: "tricks/string()" } +} diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml new file mode 100644 index 0000000..13dea91 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +XmlListModel { + source: "recipes.xml" + query: "/recipes/recipe" + XmlRole { name: "title"; query: "@title/string()" } + XmlRole { name: "picture"; query: "picture/string()" } + XmlRole { name: "ingredients"; query: "ingredients/string()" } + XmlRole { name: "preparation"; query: "method/string()" } +} diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.xml b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.xml new file mode 100644 index 0000000..d71de60 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.xml @@ -0,0 +1,90 @@ +<recipes> + <recipe title="Pancakes"> + <picture>content/pics/pancakes.jpg</picture> + <ingredients><![CDATA[<html> + <ul> + <li> 1 cup (150g) self-raising flour + <li> 1 tbs caster sugar + <li> 3/4 cup (185ml) milk + <li> 1 egg + </ul> + </html> + ]]></ingredients> + <method><![CDATA[<html> + <ol> + <li> Sift flour and sugar together into a bowl. Add a pinch of salt. + <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth. + <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface. + <li> Turn over and cook other side until golden. + </ol> + </html> + ]]></method> + </recipe> + <recipe title="Fruit Salad"> + <picture>content/pics/fruit-salad.jpg</picture> + <ingredients><![CDATA[* Seasonal Fruit]]></ingredients> + <method><![CDATA[* Chop fruit and place in a bowl.]]></method> + </recipe> + <recipe title="Vegetable Soup"> + <picture>content/pics/vegetable-soup.jpg</picture> + <ingredients><![CDATA[<html> + <ul> + <li> 1 onion + <li> 1 turnip + <li> 1 potato + <li> 1 carrot + <li> 1 head of celery + <li> 1 1/2 litres of water + </ul> + </html> + ]]></ingredients> + <method><![CDATA[<html> + <ol> + <li> Chop vegetables. + <li> Boil in water until vegetables soften. + <li> Season with salt and pepper to taste. + </ol> + </html> + ]]></method> + </recipe> + <recipe title="Hamburger"> + <picture>content/pics/hamburger.jpg</picture> + <ingredients><![CDATA[<html> + <ul> + <li> 500g minced beef + <li> Seasoning + <li> lettuce, tomato, onion, cheese + <li> 1 hamburger bun for each burger + </ul> + </html> + ]]></ingredients> + <method><![CDATA[<html> + <ol> + <li> Mix the beef, together with seasoning, in a food processor. + <li> Shape the beef into burgers. + <li> Grill the burgers for about 5 mins on each side (until cooked through) + <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion. + </ol> + </html> + ]]></method> + </recipe> + <recipe title="Lemonade"> + <picture>content/pics/lemonade.jpg</picture> + <ingredients><![CDATA[<html> + <ul> + <li> 1 cup Lemon Juice + <li> 1 cup Sugar + <li> 6 Cups of Water (2 cups warm water, 4 cups cold water) + </ul> + </html> + ]]></ingredients> + <method><![CDATA[<html> + <ol> + <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves. + <li> Pour in lemon juice, stir again, and add 4 cups of cold water. + <li> Chill or serve over ice cubes. + </ol> + </html> + ]]></method> + </recipe> +</recipes> diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml new file mode 100644 index 0000000..26c533f --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +XmlListModel { + source: "model.xml" + query: "/Pets/Pet" + XmlRole { name: "name"; query: "/name/string()" } //starts with '/' + XmlRole { name: "type"; query: "type" } //no type + XmlRole { name: "age"; query: "age/" } //ends with '/' + XmlRole { name: "size"; query: "size/number()" } //wrong type +} diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml new file mode 100644 index 0000000..b90e57e --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml @@ -0,0 +1,13 @@ +import Qt 4.6 + +XmlListModel { + query: "/data/item" + XmlRole { id: nameRole; name: "name"; query: "name/string()"; isKey: true } + XmlRole { name: "age"; query: "age/number()"; isKey: true } + XmlRole { name: "sport"; query: "sport/string()" } + + function disableNameKey() { + nameRole.isKey = false; + } +} + diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml new file mode 100644 index 0000000..ed0f293 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +XmlListModel { + source: "model.xml" + query: "/Pets/Pet" + XmlRole { name: "name"; query: "name/string()" } + XmlRole { name: "name"; query: "type/string()" } +} |