summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/layouts/data/grid-margin.qml38
-rw-r--r--tests/auto/declarative/layouts/data/grid-margin.xml9
-rw-r--r--tests/auto/declarative/layouts/data/grid-spacing-margin.qml39
-rw-r--r--tests/auto/declarative/layouts/data/grid-spacing-margin.xml9
-rw-r--r--tests/auto/declarative/layouts/data/grid-spacing.qml38
-rw-r--r--tests/auto/declarative/layouts/data/grid-spacing.xml9
-rw-r--r--tests/auto/declarative/layouts/data/grid.qml37
-rw-r--r--tests/auto/declarative/layouts/data/grid.xml9
-rw-r--r--tests/auto/declarative/layouts/data/horizontal-margin.qml25
-rw-r--r--tests/auto/declarative/layouts/data/horizontal-margin.xml7
-rw-r--r--tests/auto/declarative/layouts/data/horizontal-spacing-margin.qml26
-rw-r--r--tests/auto/declarative/layouts/data/horizontal-spacing-margin.xml7
-rw-r--r--tests/auto/declarative/layouts/data/horizontal-spacing.qml25
-rw-r--r--tests/auto/declarative/layouts/data/horizontal-spacing.xml7
-rw-r--r--tests/auto/declarative/layouts/data/horizontal.qml24
-rw-r--r--tests/auto/declarative/layouts/data/horizontal.xml7
-rw-r--r--tests/auto/declarative/layouts/data/vertical-margin.qml25
-rw-r--r--tests/auto/declarative/layouts/data/vertical-margin.xml7
-rw-r--r--tests/auto/declarative/layouts/data/vertical-spacing-margin.qml26
-rw-r--r--tests/auto/declarative/layouts/data/vertical-spacing-margin.xml7
-rw-r--r--tests/auto/declarative/layouts/data/vertical-spacing.qml25
-rw-r--r--tests/auto/declarative/layouts/data/vertical-spacing.xml7
-rw-r--r--tests/auto/declarative/layouts/data/vertical.qml24
-rw-r--r--tests/auto/declarative/layouts/data/vertical.xml7
-rw-r--r--tests/auto/declarative/layouts/tst_layouts.cpp24
-rw-r--r--tests/auto/declarative/listview/data/listview.qml39
-rw-r--r--tests/auto/declarative/listview/data/listview.xml14
-rw-r--r--tests/auto/declarative/namespaces/data/Red/Rect.qml2
-rw-r--r--tests/auto/declarative/namespaces/namespaces.pro6
-rw-r--r--tests/auto/declarative/namespaces/tst_namespaces.cpp94
-rw-r--r--tests/auto/declarative/pathview/data/pathview.qml60
-rw-r--r--tests/auto/declarative/pathview/data/pathview.xml20
-rw-r--r--tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp12
-rw-r--r--tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp6
-rw-r--r--tests/auto/declarative/qmlparser/tst_qmlparser.cpp64
-rw-r--r--tests/auto/declarative/repeater/data/repeater.qml18
-rw-r--r--tests/auto/declarative/repeater/data/repeater.xml7
-rw-r--r--tests/auto/declarative/simplecanvasitem/data/test.qml58
-rw-r--r--tests/auto/declarative/simplecanvasitem/data/test.xml12
-rw-r--r--tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp4
40 files changed, 582 insertions, 302 deletions
diff --git a/tests/auto/declarative/layouts/data/grid-margin.qml b/tests/auto/declarative/layouts/data/grid-margin.qml
new file mode 100644
index 0000000..bae47f9
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/grid-margin.qml
@@ -0,0 +1,38 @@
+Item {
+ width: 640
+ height: 480
+ GridLayout {
+ columns: 3
+ margin: 8
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rect {
+ id: three
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rect {
+ id: four
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: five
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/grid-margin.xml b/tests/auto/declarative/layouts/data/grid-margin.xml
deleted file mode 100644
index fe58eef..0000000
--- a/tests/auto/declarative/layouts/data/grid-margin.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<Item width="640" height="480">
- <GridLayout columns="3" margin="8">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="green" width="20" height="50"/>
- <Rect id="three" color="blue" width="50" height="20"/>
- <Rect id="four" color="cyan" width="50" height="50"/>
- <Rect id="five" color="magenta" width="10" height="10"/>
- </GridLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/grid-spacing-margin.qml b/tests/auto/declarative/layouts/data/grid-spacing-margin.qml
new file mode 100644
index 0000000..100d8c5
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/grid-spacing-margin.qml
@@ -0,0 +1,39 @@
+Item {
+ width: 640
+ height: 480
+ GridLayout {
+ columns: 3
+ spacing: 4
+ margin: 8
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rect {
+ id: three
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rect {
+ id: four
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: five
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/grid-spacing-margin.xml b/tests/auto/declarative/layouts/data/grid-spacing-margin.xml
deleted file mode 100644
index 807b653..0000000
--- a/tests/auto/declarative/layouts/data/grid-spacing-margin.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<Item width="640" height="480">
- <GridLayout columns="3" spacing="4" margin="8">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="green" width="20" height="50"/>
- <Rect id="three" color="blue" width="50" height="20"/>
- <Rect id="four" color="cyan" width="50" height="50"/>
- <Rect id="five" color="magenta" width="10" height="10"/>
- </GridLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/grid-spacing.qml b/tests/auto/declarative/layouts/data/grid-spacing.qml
new file mode 100644
index 0000000..494127b
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/grid-spacing.qml
@@ -0,0 +1,38 @@
+Item {
+ width: 640
+ height: 480
+ GridLayout {
+ columns: 3
+ spacing: 4
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rect {
+ id: three
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rect {
+ id: four
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: five
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/grid-spacing.xml b/tests/auto/declarative/layouts/data/grid-spacing.xml
deleted file mode 100644
index 55ef5a5..0000000
--- a/tests/auto/declarative/layouts/data/grid-spacing.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<Item width="640" height="480">
- <GridLayout columns="3" spacing="4">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="green" width="20" height="50"/>
- <Rect id="three" color="blue" width="50" height="20"/>
- <Rect id="four" color="cyan" width="50" height="50"/>
- <Rect id="five" color="magenta" width="10" height="10"/>
- </GridLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/grid.qml b/tests/auto/declarative/layouts/data/grid.qml
new file mode 100644
index 0000000..598915f
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/grid.qml
@@ -0,0 +1,37 @@
+Item {
+ width: 640
+ height: 480
+ GridLayout {
+ columns: 3
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "green"
+ width: 20
+ height: 50
+ }
+ Rect {
+ id: three
+ color: "blue"
+ width: 50
+ height: 20
+ }
+ Rect {
+ id: four
+ color: "cyan"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: five
+ color: "magenta"
+ width: 10
+ height: 10
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/grid.xml b/tests/auto/declarative/layouts/data/grid.xml
deleted file mode 100644
index abef813..0000000
--- a/tests/auto/declarative/layouts/data/grid.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<Item width="640" height="480">
- <GridLayout columns="3">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="green" width="20" height="50"/>
- <Rect id="three" color="blue" width="50" height="20"/>
- <Rect id="four" color="cyan" width="50" height="50"/>
- <Rect id="five" color="magenta" width="10" height="10"/>
- </GridLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/horizontal-margin.qml b/tests/auto/declarative/layouts/data/horizontal-margin.qml
new file mode 100644
index 0000000..8bf2329
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/horizontal-margin.qml
@@ -0,0 +1,25 @@
+Item {
+ width: 640
+ height: 480
+ HorizontalLayout {
+ margin: 10
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rect {
+ id: three
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/horizontal-margin.xml b/tests/auto/declarative/layouts/data/horizontal-margin.xml
deleted file mode 100644
index 7ee9706..0000000
--- a/tests/auto/declarative/layouts/data/horizontal-margin.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Item width="640" height="480">
- <HorizontalLayout margin="10">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="red" width="20" height="10"/>
- <Rect id="three" color="red" width="40" height="20"/>
- </HorizontalLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing-margin.qml b/tests/auto/declarative/layouts/data/horizontal-spacing-margin.qml
new file mode 100644
index 0000000..79652f6
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/horizontal-spacing-margin.qml
@@ -0,0 +1,26 @@
+Item {
+ width: 640
+ height: 480
+ HorizontalLayout {
+ spacing: 5
+ margin: 10
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rect {
+ id: three
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing-margin.xml b/tests/auto/declarative/layouts/data/horizontal-spacing-margin.xml
deleted file mode 100644
index 8767818..0000000
--- a/tests/auto/declarative/layouts/data/horizontal-spacing-margin.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Item width="640" height="480">
- <HorizontalLayout spacing="5" margin="10">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="red" width="20" height="10"/>
- <Rect id="three" color="red" width="40" height="20"/>
- </HorizontalLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing.qml b/tests/auto/declarative/layouts/data/horizontal-spacing.qml
new file mode 100644
index 0000000..5130e4a
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/horizontal-spacing.qml
@@ -0,0 +1,25 @@
+Item {
+ width: 640
+ height: 480
+ HorizontalLayout {
+ spacing: 10
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rect {
+ id: three
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/horizontal-spacing.xml b/tests/auto/declarative/layouts/data/horizontal-spacing.xml
deleted file mode 100644
index cb58711..0000000
--- a/tests/auto/declarative/layouts/data/horizontal-spacing.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Item width="640" height="480">
- <HorizontalLayout spacing="10">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="red" width="20" height="10"/>
- <Rect id="three" color="red" width="40" height="20"/>
- </HorizontalLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/horizontal.qml b/tests/auto/declarative/layouts/data/horizontal.qml
new file mode 100644
index 0000000..7ad6b55
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/horizontal.qml
@@ -0,0 +1,24 @@
+Item {
+ width: 640
+ height: 480
+ HorizontalLayout {
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rect {
+ id: three
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/horizontal.xml b/tests/auto/declarative/layouts/data/horizontal.xml
deleted file mode 100644
index f9deaf1..0000000
--- a/tests/auto/declarative/layouts/data/horizontal.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Item width="640" height="480">
- <HorizontalLayout>
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="red" width="20" height="10"/>
- <Rect id="three" color="red" width="40" height="20"/>
- </HorizontalLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/vertical-margin.qml b/tests/auto/declarative/layouts/data/vertical-margin.qml
new file mode 100644
index 0000000..ad34906
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/vertical-margin.qml
@@ -0,0 +1,25 @@
+Item {
+ width: 640
+ height: 480
+ VerticalLayout {
+ margin: 10
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rect {
+ id: three
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/vertical-margin.xml b/tests/auto/declarative/layouts/data/vertical-margin.xml
deleted file mode 100644
index abd7635..0000000
--- a/tests/auto/declarative/layouts/data/vertical-margin.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Item width="640" height="480">
- <VerticalLayout margin="10">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="red" width="20" height="10"/>
- <Rect id="three" color="red" width="40" height="20"/>
- </VerticalLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/vertical-spacing-margin.qml b/tests/auto/declarative/layouts/data/vertical-spacing-margin.qml
new file mode 100644
index 0000000..5de50b3
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/vertical-spacing-margin.qml
@@ -0,0 +1,26 @@
+Item {
+ width: 640
+ height: 480
+ VerticalLayout {
+ spacing: 5
+ margin: 10
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rect {
+ id: three
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/vertical-spacing-margin.xml b/tests/auto/declarative/layouts/data/vertical-spacing-margin.xml
deleted file mode 100644
index 3d41ca0..0000000
--- a/tests/auto/declarative/layouts/data/vertical-spacing-margin.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Item width="640" height="480">
- <VerticalLayout spacing="5" margin="10">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="red" width="20" height="10"/>
- <Rect id="three" color="red" width="40" height="20"/>
- </VerticalLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/vertical-spacing.qml b/tests/auto/declarative/layouts/data/vertical-spacing.qml
new file mode 100644
index 0000000..c364e3f
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/vertical-spacing.qml
@@ -0,0 +1,25 @@
+Item {
+ width: 640
+ height: 480
+ VerticalLayout {
+ spacing: 10
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rect {
+ id: three
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/vertical-spacing.xml b/tests/auto/declarative/layouts/data/vertical-spacing.xml
deleted file mode 100644
index e25f981..0000000
--- a/tests/auto/declarative/layouts/data/vertical-spacing.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Item width="640" height="480">
- <VerticalLayout spacing="10">
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="red" width="20" height="10"/>
- <Rect id="three" color="red" width="40" height="20"/>
- </VerticalLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/data/vertical.qml b/tests/auto/declarative/layouts/data/vertical.qml
new file mode 100644
index 0000000..50931cd
--- /dev/null
+++ b/tests/auto/declarative/layouts/data/vertical.qml
@@ -0,0 +1,24 @@
+Item {
+ width: 640
+ height: 480
+ VerticalLayout {
+ Rect {
+ id: one
+ color: "red"
+ width: 50
+ height: 50
+ }
+ Rect {
+ id: two
+ color: "red"
+ width: 20
+ height: 10
+ }
+ Rect {
+ id: three
+ color: "red"
+ width: 40
+ height: 20
+ }
+ }
+}
diff --git a/tests/auto/declarative/layouts/data/vertical.xml b/tests/auto/declarative/layouts/data/vertical.xml
deleted file mode 100644
index 198d99f..0000000
--- a/tests/auto/declarative/layouts/data/vertical.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Item width="640" height="480">
- <VerticalLayout>
- <Rect id="one" color="red" width="50" height="50"/>
- <Rect id="two" color="red" width="20" height="10"/>
- <Rect id="three" color="red" width="40" height="20"/>
- </VerticalLayout>
-</Item>
diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp
index 3fc4678..732551c 100644
--- a/tests/auto/declarative/layouts/tst_layouts.cpp
+++ b/tests/auto/declarative/layouts/tst_layouts.cpp
@@ -36,7 +36,7 @@ tst_QFxLayouts::tst_QFxLayouts()
void tst_QFxLayouts::test_horizontal()
{
- QFxView *canvas = createView(SRCDIR "/data/horizontal.xml");
+ QFxView *canvas = createView(SRCDIR "/data/horizontal.qml");
canvas->execute();
qApp->processEvents();
@@ -60,7 +60,7 @@ void tst_QFxLayouts::test_horizontal()
void tst_QFxLayouts::test_horizontal_spacing()
{
- QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing.xml");
+ QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing.qml");
canvas->execute();
qApp->processEvents();
@@ -84,7 +84,7 @@ void tst_QFxLayouts::test_horizontal_spacing()
void tst_QFxLayouts::test_horizontal_margin()
{
- QFxView *canvas = createView(SRCDIR "/data/horizontal-margin.xml");
+ QFxView *canvas = createView(SRCDIR "/data/horizontal-margin.qml");
canvas->execute();
qApp->processEvents();
@@ -108,7 +108,7 @@ void tst_QFxLayouts::test_horizontal_margin()
void tst_QFxLayouts::test_horizontal_spacing_margin()
{
- QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing-margin.xml");
+ QFxView *canvas = createView(SRCDIR "/data/horizontal-spacing-margin.qml");
canvas->execute();
qApp->processEvents();
@@ -132,7 +132,7 @@ void tst_QFxLayouts::test_horizontal_spacing_margin()
void tst_QFxLayouts::test_vertical()
{
- QFxView *canvas = createView(SRCDIR "/data/vertical.xml");
+ QFxView *canvas = createView(SRCDIR "/data/vertical.qml");
canvas->execute();
qApp->processEvents();
@@ -156,7 +156,7 @@ void tst_QFxLayouts::test_vertical()
void tst_QFxLayouts::test_vertical_spacing()
{
- QFxView *canvas = createView(SRCDIR "/data/vertical-spacing.xml");
+ QFxView *canvas = createView(SRCDIR "/data/vertical-spacing.qml");
canvas->execute();
qApp->processEvents();
@@ -180,7 +180,7 @@ void tst_QFxLayouts::test_vertical_spacing()
void tst_QFxLayouts::test_vertical_margin()
{
- QFxView *canvas = createView(SRCDIR "/data/vertical-margin.xml");
+ QFxView *canvas = createView(SRCDIR "/data/vertical-margin.qml");
canvas->execute();
qApp->processEvents();
@@ -204,7 +204,7 @@ void tst_QFxLayouts::test_vertical_margin()
void tst_QFxLayouts::test_vertical_spacing_margin()
{
- QFxView *canvas = createView(SRCDIR "/data/vertical-spacing-margin.xml");
+ QFxView *canvas = createView(SRCDIR "/data/vertical-spacing-margin.qml");
canvas->execute();
qApp->processEvents();
@@ -228,7 +228,7 @@ void tst_QFxLayouts::test_vertical_spacing_margin()
void tst_QFxLayouts::test_grid()
{
- QFxView *canvas = createView("data/grid.xml");
+ QFxView *canvas = createView("data/grid.qml");
canvas->execute();
qApp->processEvents();
@@ -258,7 +258,7 @@ void tst_QFxLayouts::test_grid()
void tst_QFxLayouts::test_grid_spacing()
{
- QFxView *canvas = createView("data/grid-spacing.xml");
+ QFxView *canvas = createView("data/grid-spacing.qml");
canvas->execute();
qApp->processEvents();
@@ -288,7 +288,7 @@ void tst_QFxLayouts::test_grid_spacing()
void tst_QFxLayouts::test_grid_margin()
{
- QFxView *canvas = createView("data/grid-margin.xml");
+ QFxView *canvas = createView("data/grid-margin.qml");
canvas->execute();
qApp->processEvents();
@@ -319,7 +319,7 @@ void tst_QFxLayouts::test_grid_margin()
void tst_QFxLayouts::test_grid_spacing_margin()
{
- QFxView *canvas = createView("data/grid-spacing-margin.xml");
+ QFxView *canvas = createView("data/grid-spacing-margin.qml");
canvas->execute();
qApp->processEvents();
diff --git a/tests/auto/declarative/listview/data/listview.qml b/tests/auto/declarative/listview/data/listview.qml
new file mode 100644
index 0000000..891f9a8
--- /dev/null
+++ b/tests/auto/declarative/listview/data/listview.qml
@@ -0,0 +1,39 @@
+Rect {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: Delegate
+ Item {
+ id: wrapper
+ height: 20
+ width: 240
+ Text {
+ text: index
+ }
+ Text {
+ x: 30
+ id: textName
+ text: name
+ }
+ Text {
+ x: 120
+ id: textNumber
+ text: number
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ }
+ }
+ }
+ ]
+ ListView {
+ id: list
+ width: 240
+ height: 320
+ model: testModel
+ delegate: Delegate
+ }
+}
diff --git a/tests/auto/declarative/listview/data/listview.xml b/tests/auto/declarative/listview/data/listview.xml
deleted file mode 100644
index 7fda2b5..0000000
--- a/tests/auto/declarative/listview/data/listview.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<Rect width="240" height="320" color="#ffffff">
- <resources>
- <Component id="Delegate">
- <Item id="wrapper" height="20" width="240">
- <Text text="{index}"/>
- <Text x="30" id="textName" text="{name}"/>
- <Text x="120" id="textNumber" text="{number}"/>
- <Text x="200" text="{wrapper.y}"/>
- </Item>
- </Component>
- </resources>
- <ListView id="list" width="240" height="320" model="{testModel}" delegate="{Delegate}">
- </ListView>
-</Rect>
diff --git a/tests/auto/declarative/namespaces/data/Red/Rect.qml b/tests/auto/declarative/namespaces/data/Red/Rect.qml
deleted file mode 100644
index c7b3d8c..0000000
--- a/tests/auto/declarative/namespaces/data/Red/Rect.qml
+++ /dev/null
@@ -1,2 +0,0 @@
-<Text objectName="x" text="Pretending to be a Rect" color="red">
-</Text>
diff --git a/tests/auto/declarative/namespaces/namespaces.pro b/tests/auto/declarative/namespaces/namespaces.pro
deleted file mode 100644
index f232770..0000000
--- a/tests/auto/declarative/namespaces/namespaces.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
-SOURCES += tst_namespaces.cpp
-
-# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/declarative/namespaces/tst_namespaces.cpp b/tests/auto/declarative/namespaces/tst_namespaces.cpp
deleted file mode 100644
index e9529ff..0000000
--- a/tests/auto/declarative/namespaces/tst_namespaces.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-#include <qtest.h>
-#include <QtDeclarative/qfxview.h>
-#include <QtDeclarative/qmlcontext.h>
-#include <QtDeclarative/qmlengine.h>
-#include <QtDeclarative/qfxrect.h>
-#include <QtDeclarative/qfxtext.h>
-#include <QDir>
-
-class tst_namespaces : public QObject
-
-{
- Q_OBJECT
-public:
- tst_namespaces();
-
-private slots:
- void simple();
- void simple_data();
-};
-
-tst_namespaces::tst_namespaces()
-{
-}
-
-void tst_namespaces::simple_data()
-{
- QTest::addColumn<QString>("qml");
- QTest::addColumn<bool>("valid");
- QTest::addColumn<QString>("texts");
- QTest::addColumn<QString>("rects");
-
- QTest::newRow("Control") <<
- "<Rect objectName=\"a\">"
- "<Rect objectName=\"b\"/>"
- "</Rect>"
- << true << "" << "ab";
-
- QTest::newRow("Control2") <<
- "<Rect objectName=\"a\">"
- "<Text objectName=\"b\"/>"
- "</Rect>"
- << true << "b" << "a";
-
- QTest::newRow("Replace builtin") <<
- "<Rect objectName=\"a\" xmlns:rs=\"http://nokia.com/qml/Red\">"
- "<rs:Rect objectName=\"b\"/>"
- "</Rect>"
- << true << "b" << "a";
-}
-
-void tst_namespaces::simple()
-{
- QFETCH(QString, qml);
- QFETCH(bool, valid);
- QFETCH(QString, texts);
- QFETCH(QString, rects);
-
- QFxView canvas(0);
- canvas.rootContext()->engine()->addNameSpacePath("http://nokia.com/qml", SRCDIR "/data");
- canvas.setQml(qml);
- canvas.execute();
- qApp->processEvents();
-
- QFxItem *testObject = qobject_cast<QFxItem*>(canvas.root());
-
- QCOMPARE((testObject != 0),valid);
-
- if (valid && testObject != 0) {
- QString textids;
- QList<QFxText*> textobjects = testObject->findChildren<QFxText*>();
- if (qobject_cast<QFxText*>(testObject))
- textids += testObject->objectName();
- foreach (QFxText *obj, textobjects) {
- textids += obj->objectName();
- }
- if (textids != texts)
- testObject->dump();
- QCOMPARE(textids,texts);
-
- QString rectids;
- QList<QFxRect*> rectobjects = testObject->findChildren<QFxRect*>();
- if (qobject_cast<QFxRect*>(testObject))
- rectids += testObject->objectName();
- foreach (QFxRect *obj, rectobjects)
- rectids += obj->objectName();
- if (rectids != rects)
- testObject->dump();
- QCOMPARE(rectids,rects);
- }
-}
-
-QTEST_MAIN(tst_namespaces)
-
-#include "tst_namespaces.moc"
diff --git a/tests/auto/declarative/pathview/data/pathview.qml b/tests/auto/declarative/pathview/data/pathview.qml
new file mode 100644
index 0000000..0fec1e9
--- /dev/null
+++ b/tests/auto/declarative/pathview/data/pathview.qml
@@ -0,0 +1,60 @@
+Rect {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ resources: [
+ Component {
+ id: Delegate
+ Rect {
+ id: wrapper
+ height: 20
+ width: 60
+ color: "white"
+ pen.color: "black"
+ Text {
+ text: index
+ }
+ Text {
+ x: 20
+ id: textName
+ text: name
+ }
+ Text {
+ x: 40
+ id: textNumber
+ text: number
+ }
+ }
+ }
+ ]
+ PathView {
+ id: view
+ width: 240
+ height: 320
+ model: testModel
+ delegate: Delegate
+ snapPos: 0.01
+ path: Path {
+ startY: 120
+ startX: 160
+ PathQuad {
+ y: 120
+ x: 80
+ controlY: 330
+ controlX: 100
+ }
+ PathLine {
+ y: 160
+ x: 20
+ }
+ PathCubic {
+ y: 120
+ x: 160
+ control1Y: 0
+ control1X: 100
+ control2Y: 000
+ control2X: 200
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/pathview/data/pathview.xml b/tests/auto/declarative/pathview/data/pathview.xml
deleted file mode 100644
index 26b426c..0000000
--- a/tests/auto/declarative/pathview/data/pathview.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<Rect width="240" height="320" color="#ffffff">
- <resources>
- <Component id="Delegate">
- <Rect id="wrapper" height="20" width="60" color="white" pen.color="black">
- <Text text="{index}"/>
- <Text x="20" id="textName" text="{name}"/>
- <Text x="40" id="textNumber" text="{number}"/>
- </Rect>
- </Component>
- </resources>
- <PathView id="view" width="240" height="320" model="{testModel}" delegate="{Delegate}" snapPos="0.01">
- <path>
- <Path startY="120" startX="160">
- <PathQuad y="120" x="80" controlY="330" controlX="100"/>
- <PathLine y="160" x="20"/>
- <PathCubic y="120" x="160" control1Y="0" control1X="100" control2Y="000" control2X="200"/>
- </Path>
- </path>
- </PathView>
-</Rect>
diff --git a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
index f5b32e8..0875690 100644
--- a/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
+++ b/tests/auto/declarative/qmlbindengine/tst_qmlbindengine.cpp
@@ -59,13 +59,13 @@ private:
void tst_qmlbindengine::boolPropertiesEvaluateAsBool()
{
{
- QmlComponent component(&engine, "<MyQmlObject stringProperty=\"{trueProperty?'pass':'fail'}\" />");
+ QmlComponent component(&engine, "MyQmlObject { stringProperty: trueProperty?'pass':'fail' }");
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->stringProperty(), QLatin1String("pass"));
}
{
- QmlComponent component(&engine, "<MyQmlObject stringProperty=\"{falseProperty?'fail':'pass'}\" />");
+ QmlComponent component(&engine, "MyQmlObject { stringProperty: falseProperty?'fail':'pass' }");
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->stringProperty(), QLatin1String("pass"));
@@ -75,7 +75,7 @@ void tst_qmlbindengine::boolPropertiesEvaluateAsBool()
void tst_qmlbindengine::signalAssignment()
{
{
- QmlComponent component(&engine, "<MyQmlObject onBasicSignal=\"setString('pass')\" />");
+ QmlComponent component(&engine, "MyQmlObject { onBasicSignal: setString('pass') }");
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->string(), QString());
@@ -84,7 +84,7 @@ void tst_qmlbindengine::signalAssignment()
}
{
- QmlComponent component(&engine, "<MyQmlObject onArgumentSignal=\"setString('pass ' + a + ' ' + b + ' ' + c)\" />");
+ QmlComponent component(&engine, "MyQmlObject { onArgumentSignal: setString('pass ' + a + ' ' + b + ' ' + c) }");
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->string(), QString());
@@ -96,7 +96,7 @@ void tst_qmlbindengine::signalAssignment()
void tst_qmlbindengine::methods()
{
{
- QmlComponent component(&engine, "<MyQmlObject id=\"MyObject\" onBasicSignal=\"MyObject.method()\" />");
+ QmlComponent component(&engine, "MyQmlObject { id: MyObject; onBasicSignal: MyObject.method() }");
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->methodCalled(), false);
@@ -107,7 +107,7 @@ void tst_qmlbindengine::methods()
}
{
- QmlComponent component(&engine, "<MyQmlObject id=\"MyObject\" onBasicSignal=\"MyObject.method(163)\" />");
+ QmlComponent component(&engine, "MyQmlObject { id: MyObject; onBasicSignal: MyObject.method(163) }");
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->methodCalled(), false);
diff --git a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
index 1163dda..e35a006 100644
--- a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
+++ b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
@@ -52,7 +52,7 @@ private:
void tst_QmlMetaProperty::writeObjectToList()
{
- QmlComponent containerComponent(&engine, "<MyContainer><children><MyQmlObject/></children></MyContainer>");
+ QmlComponent containerComponent(&engine, "MyContainer { children: MyQmlObject {} }");
MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
QVERIFY(container != 0);
QVERIFY(container->children()->size() == 1);
@@ -67,7 +67,7 @@ void tst_QmlMetaProperty::writeObjectToList()
Q_DECLARE_METATYPE(QList<QObject *>);
void tst_QmlMetaProperty::writeListToList()
{
- QmlComponent containerComponent(&engine, "<MyContainer><children><MyQmlObject/></children></MyContainer>");
+ QmlComponent containerComponent(&engine, "MyContainer { children: MyQmlObject {} }");
MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
QVERIFY(container != 0);
QVERIFY(container->children()->size() == 1);
@@ -87,7 +87,7 @@ void tst_QmlMetaProperty::writeListToList()
void tst_QmlMetaProperty::writeObjectToQmlList()
{
- QmlComponent containerComponent(&engine, "<MyContainer><qmlChildren><MyQmlObject/></qmlChildren></MyContainer>");
+ QmlComponent containerComponent(&engine, "MyContainer { qmlChildren: MyQmlObject {} }");
MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
QVERIFY(container != 0);
QVERIFY(container->qmlChildren()->size() == 1);
diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp
index 24d3c22..96f6f4f 100644
--- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp
+++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp
@@ -147,13 +147,13 @@ private slots:
//void readWriteDotProperty();
void emptyInput();
void missingObject();
- void invalidXML();
+ //void invalidXML();
void duplicateIDs();
void invalidID();
void interfaceProperty();
void interfaceQmlList();
void interfaceQList();
- void cannotAssignBindingToSignal();
+ //void cannotAssignBindingToSignal();
void assignObjectToSignal();
private:
@@ -162,14 +162,14 @@ private:
void tst_qmlparser::simpleObject()
{
- QmlComponent component(&engine, "<MyQmlObject/>");
+ QmlComponent component(&engine, "MyQmlObject {}");
QObject *object = component.create();
QVERIFY(object != 0);
}
void tst_qmlparser::simpleContainer()
{
- QmlComponent component(&engine, "<MyContainer>\n<MyQmlObject/>\n<MyQmlObject/>\n</MyContainer>");
+ QmlComponent component(&engine, "MyContainer {\nMyQmlObject{}\nMyQmlObject{}\n}");
MyContainer *container= qobject_cast<MyContainer*>(component.create());
QVERIFY(container != 0);
QCOMPARE(container->children()->count(),2);
@@ -177,7 +177,7 @@ void tst_qmlparser::simpleContainer()
void tst_qmlparser::unregisteredObject()
{
- QmlComponent component(&engine, "<UnRegisteredObject/>", QUrl("myprogram.qml"));
+ QmlComponent component(&engine, "UnRegisteredObject {}", QUrl("myprogram.qml"));
QTest::ignoreMessage(QtWarningMsg, "Unable to create object of type 'UnRegisteredObject' @myprogram.qml:1");
QObject *object = component.create();
QVERIFY(object == 0);
@@ -187,14 +187,14 @@ void tst_qmlparser::nonexistantProperty()
{
//NOTE: these first 3 should all have the same error message
{
- QmlComponent component(&engine, "<MyQmlObject something=\"24\"/>");
+ QmlComponent component(&engine, "MyQmlObject { something: 24 }");
QTest::ignoreMessage(QtWarningMsg, "Unknown property 'something' @<unspecified file>:1");
QObject *object = component.create();
QVERIFY(object == 0);
}
{
- QmlComponent component(&engine, "<MyQmlObject>\n<something>24</something>\n</MyQmlObject>");
+ QmlComponent component(&engine, "MyQmlObject {\n something: 24\n}");
QTest::ignoreMessage(QtWarningMsg, "Unknown property 'something' @<unspecified file>:2");
QObject *object = component.create();
QVERIFY(object == 0);
@@ -202,21 +202,21 @@ void tst_qmlparser::nonexistantProperty()
//non-existant using binding
{
- QmlComponent component(&engine, "<MyQmlObject something=\"{1}\"/>");
+ QmlComponent component(&engine, "MyQmlObject { something: 1 + 1 }");
QTest::ignoreMessage(QtWarningMsg, "Unknown property 'something' @<unspecified file>:1");
QObject *object = component.create();
QVERIFY(object == 0);
}
{
- QmlComponent component(&engine, "<MyQmlObject><something></something></MyQmlObject>");
+ QmlComponent component(&engine, "MyQmlObject { something: }");
QObject *object = component.create();
QVERIFY(object != 0);
}
//non-existant value-type default property
{
- QmlComponent component(&engine, "<MyQmlObject>\n24\n</MyQmlObject>");
+ QmlComponent component(&engine, "MyQmlObject {\n24\n}");
QTest::ignoreMessage(QtWarningMsg, "Unable to resolve default property @<unspecified file>:3");
// XXX would 2 be a better line number in this case? Message should also be improved.
QObject *object = component.create();
@@ -225,7 +225,7 @@ void tst_qmlparser::nonexistantProperty()
//non-existant object-type default property
{
- QmlComponent component(&engine, "<MyQmlObject>\n<MyQmlObject/>\n</MyQmlObject>");
+ QmlComponent component(&engine, "MyQmlObject {\nMyQmlObject{}\n}");
QTest::ignoreMessage(QtWarningMsg, "Unable to assign to non-existant property @<unspecified file>:2");
// XXX Message needs to be improved (and should be closer to value-type message).
QObject *object = component.create();
@@ -236,7 +236,7 @@ void tst_qmlparser::nonexistantProperty()
void tst_qmlparser::unsupportedProperty()
{
QTest::ignoreMessage(QtWarningMsg, "Property 'matrix' is of an unknown type @<unspecified file>:1");
- QmlComponent component(&engine, "<MyQmlObject matrix=\"1,0,0,0,1,0,0,0,1\"/>");
+ QmlComponent component(&engine, "MyQmlObject { matrix: \"1,0,0,0,1,0,0,0,1\" }");
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
QVERIFY(object == 0);
}
@@ -246,7 +246,7 @@ void tst_qmlparser::wrongType()
//string for int
{
QTest::ignoreMessage(QtWarningMsg, "Can't assign value 'hello' to property 'value' @<unspecified file>:1");
- QmlComponent component(&engine, "<MyQmlObject value=\"hello\"/>");
+ QmlComponent component(&engine, "MyQmlObject { value: \"hello\" }");
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
QVERIFY(object == 0);
}
@@ -254,7 +254,7 @@ void tst_qmlparser::wrongType()
//int for bool
{
QTest::ignoreMessage(QtWarningMsg, "Can't assign value '5' to property 'enabled' @<unspecified file>:1");
- QmlComponent component(&engine, "<MyQmlObject enabled=\"5\"/>");
+ QmlComponent component(&engine, "MyQmlObject { enabled: 5 }");
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
QVERIFY(object == 0);
}
@@ -262,7 +262,7 @@ void tst_qmlparser::wrongType()
//bad format for rect
{
QTest::ignoreMessage(QtWarningMsg, "Can't assign value '5,5x10' to property 'rect' @<unspecified file>:1");
- QmlComponent component(&engine, "<MyQmlObject rect=\"5,5x10\"/>");
+ QmlComponent component(&engine, "MyQmlObject { rect: \"5,5x10\" }");
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
QVERIFY(object == 0);
}
@@ -274,14 +274,14 @@ void tst_qmlparser::readOnly()
{
{
QTest::ignoreMessage(QtWarningMsg, "Can't assign value 'hello' to property 'readOnlyString' because 'readOnlyString' is read-only @<unspecified file>:1");
- QmlComponent component(&engine, "<MyQmlObject readOnlyString=\"hello\"/>");
+ QmlComponent component(&engine, "MyQmlObject { readOnlyString: \"hello\" }");
QObject *object = component.create();
QVERIFY(object == 0);
}
{
QTest::ignoreMessage(QtWarningMsg, "Can't assign a binding to property 'readOnlyString' because 'readOnlyString' is read-only @<unspecified file>:1");
- QmlComponent component(&engine, "<MyQmlObject readOnlyString=\"{'hello'}\"/>");
+ QmlComponent component(&engine, "MyQmlObject { readOnlyString: {'hello'} }");
QObject *object = component.create();
QVERIFY(object == 0);
}
@@ -290,7 +290,7 @@ void tst_qmlparser::readOnly()
void tst_qmlparser::nullDotProperty()
{
QTest::ignoreMessage(QtWarningMsg, "Can't set properties on 'obj' because it is null @<unspecified file>:1");
- QmlComponent component(&engine, "<MyDotPropertyObject obj.value=\"1\"/>");
+ QmlComponent component(&engine, "MyDotPropertyObject { obj.value: 1 }");
QObject *object = component.create();
QVERIFY(object == 0);
}
@@ -298,7 +298,7 @@ void tst_qmlparser::nullDotProperty()
void tst_qmlparser::fakeDotProperty()
{
QTest::ignoreMessage(QtWarningMsg, "Can't set properties on 'value' because it isn't a known object type @<unspecified file>:1");
- QmlComponent component(&engine, "<MyQmlObject value.something=\"hello\"/>");
+ QmlComponent component(&engine, "MyQmlObject { value.something: \"hello\" }");
QObject *object = component.create();
QVERIFY(object == 0);
}
@@ -306,13 +306,13 @@ void tst_qmlparser::fakeDotProperty()
//XXX need to define correct behavior first
/*void tst_qmlparser::readWriteDotProperty()
{
- QmlComponent component(&engine, "<MyDotPropertyObject readWriteObj.value=\"1\"/>");
+ QmlComponent component(&engine, "MyDotPropertyObject { readWriteObj.value: 1 }");
MyDotPropertyObject *object = qobject_cast<MyDotPropertyObject*>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->readWriteObj()->value(),1);
{
- QmlComponent component(&engine, "<MyContainer><MyQmlObject id=\"Obj\" value=\"1\"/><MyDotPropertyObject readWriteObj=\"{Obj}\"/></MyContainer>");
+ QmlComponent component(&engine, "MyContainer { MyQmlObject { id: Obj value: 1 } MyDotPropertyObject { readWriteObj: Obj } }");
MyContainer *object = qobject_cast<MyContainer*>(component.create());
QVERIFY(object != 0);
MyDotPropertyObject *dpo = qobject_cast<MyDotPropertyObject *>(object->children()->at(1));
@@ -333,13 +333,13 @@ void tst_qmlparser::missingObject()
{
QTest::ignoreMessage(QtCriticalMsg, "Can't have a property with no object @<unspecified file>:1");
QTest::ignoreMessage(QtWarningMsg, "Can't compile because of earlier errors @<unspecified file>:-1");
- QmlComponent component(&engine, "<something/>");
+ QmlComponent component(&engine, "something:");
QObject *object = component.create();
QVERIFY(object == 0);
}
-void tst_qmlparser::invalidXML()
+/*void tst_qmlparser::invalidXML()
{
//extra stuff on end
{
@@ -375,12 +375,12 @@ void tst_qmlparser::invalidXML()
QVERIFY(object == 0);
}
-}
+}*/
void tst_qmlparser::duplicateIDs()
{
QTest::ignoreMessage(QtWarningMsg, "An id (\"MyID\") is not unique within its scope. @<unspecified file>:3");
- QmlComponent component(&engine, "<MyContainer>\n<MyQmlObject id=\"MyID\"/>\n<MyQmlObject id=\"MyID\"/>\n</MyContainer>");
+ QmlComponent component(&engine, "MyContainer {\nMyQmlObject { id: MyID }\nMyQmlObject { id: MyID }\n}");
QObject *object = component.create();
QVERIFY(object == 0);
}
@@ -388,14 +388,14 @@ void tst_qmlparser::duplicateIDs()
void tst_qmlparser::invalidID()
{
QTest::ignoreMessage(QtWarningMsg, "'1' is not a valid id @<unspecified file>:1");
- QmlComponent component(&engine, "<MyQmlObject id=\"1\"/>");
+ QmlComponent component(&engine, "MyQmlObject { id: 1 }");
QObject *object = component.create();
QVERIFY(object == 0);
}
void tst_qmlparser::interfaceProperty()
{
- QmlComponent component(&engine, "<MyQmlObject><interface>\n<MyQmlObject/></interface>\n</MyQmlObject>");
+ QmlComponent component(&engine, "MyQmlObject { interface: MyQmlObject }");
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
QVERIFY(object != 0);
QVERIFY(object->interface());
@@ -404,7 +404,7 @@ void tst_qmlparser::interfaceProperty()
void tst_qmlparser::interfaceQmlList()
{
- QmlComponent component(&engine, "<MyContainer><qmllistInterfaces>\n<MyQmlObject/>\n<MyQmlObject/>\n</qmllistInterfaces>\n</MyContainer>");
+ QmlComponent component(&engine, "MyContainer { qmllistInterfaces: MyQmlObject {} }");
MyContainer *container= qobject_cast<MyContainer*>(component.create());
QVERIFY(container != 0);
QVERIFY(container->qmllistAccessor().count() == 2);
@@ -414,7 +414,7 @@ void tst_qmlparser::interfaceQmlList()
void tst_qmlparser::interfaceQList()
{
- QmlComponent component(&engine, "<MyContainer><qlistInterfaces>\n<MyQmlObject/>\n<MyQmlObject/>\n</qlistInterfaces>\n</MyContainer>");
+ QmlComponent component(&engine, "MyContainer { qlistInterfaces: MyQmlObject {} }");
MyContainer *container= qobject_cast<MyContainer*>(component.create());
QVERIFY(container != 0);
QVERIFY(container->qlistInterfaces()->count() == 2);
@@ -422,17 +422,17 @@ void tst_qmlparser::interfaceQList()
QVERIFY(container->qlistInterfaces()->at(ii)->id == 913);
}
-void tst_qmlparser::cannotAssignBindingToSignal()
+/*void tst_qmlparser::cannotAssignBindingToSignal()
{
QTest::ignoreMessage(QtWarningMsg, "Cannot assign binding to signal property @<unspecified file>:1");
QmlComponent component(&engine, "<MyQmlObject onBasicSignal=\"{print(1921)}\" />");
MyContainer *container= qobject_cast<MyContainer*>(component.create());
QVERIFY(container == 0);
-}
+}*/
void tst_qmlparser::assignObjectToSignal()
{
- QmlComponent component(&engine, "<MyQmlObject><onBasicSignal><MyQmlObject /></onBasicSignal></MyQmlObject>");
+ QmlComponent component(&engine, "MyQmlObject { onBasicSignal: MyQmlObject {} }");
MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
QVERIFY(object != 0);
QTest::ignoreMessage(QtWarningMsg, "MyQmlObject::basicSlot");
diff --git a/tests/auto/declarative/repeater/data/repeater.qml b/tests/auto/declarative/repeater/data/repeater.qml
new file mode 100644
index 0000000..2498646
--- /dev/null
+++ b/tests/auto/declarative/repeater/data/repeater.qml
@@ -0,0 +1,18 @@
+Rect {
+ id: container
+ width: 240
+ height: 320
+ color: "white"
+ Repeater {
+ id: repeater
+ width: 240
+ height: 320
+ dataSource: testData
+ Component {
+ Text {
+ y: index*20
+ text: modelData
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/repeater/data/repeater.xml b/tests/auto/declarative/repeater/data/repeater.xml
deleted file mode 100644
index f863716..0000000
--- a/tests/auto/declarative/repeater/data/repeater.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<Rect id="container" width="240" height="320" color="white">
- <Repeater id="repeater" width="240" height="320" dataSource="{testData}">
- <Component>
- <Text y="{index*20}" text="{modelData}"/>
- </Component>
- </Repeater>
-</Rect>
diff --git a/tests/auto/declarative/simplecanvasitem/data/test.qml b/tests/auto/declarative/simplecanvasitem/data/test.qml
new file mode 100644
index 0000000..d206a6b
--- /dev/null
+++ b/tests/auto/declarative/simplecanvasitem/data/test.qml
@@ -0,0 +1,58 @@
+Item {
+ width: 320
+ height: 480
+ Rect {
+ color: "blue"
+ x: 20
+ y: 20
+ width: 20
+ height: 20
+ Rect {
+ color: "black"
+ x: 20
+ y: 20
+ width: 10
+ height: 10
+ }
+ }
+ Rect {
+ color: "red"
+ x: 40
+ y: 20
+ width: 20
+ height: 20
+ }
+ Rect {
+ color: "green"
+ x: 60
+ y: 20
+ width: 20
+ height: 20
+ }
+ Rect {
+ color: "yellow"
+ x: 20
+ y: 40
+ width: 20
+ height: 20
+ }
+ Rect {
+ color: "purple"
+ x: 20
+ y: 60
+ width: 20
+ height: 20
+ }
+ Rect {
+ color: "white"
+ x: 40
+ y: 40
+ width: 20
+ height: 20
+ }
+ Rect {
+ anchors.fill: parent
+ color: "gray"
+ z: -1
+ }
+}
diff --git a/tests/auto/declarative/simplecanvasitem/data/test.xml b/tests/auto/declarative/simplecanvasitem/data/test.xml
deleted file mode 100644
index 9b8f10a..0000000
--- a/tests/auto/declarative/simplecanvasitem/data/test.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<Item width="320" height="480">
- <Rect color="blue" x="20" y="20" width="20" height="20">
- <Rect color="black" x="20" y="20" width="10" height="10"/>
- </Rect>
- <Rect color="red" x="40" y="20" width="20" height="20"/>
- <Rect color="green" x="60" y="20" width="20" height="20"/>
- <Rect color="yellow" x="20" y="40" width="20" height="20"/>
- <Rect color="purple" x="20" y="60" width="20" height="20"/>
- <Rect color="white" x="40" y="40" width="20" height="20"/>
- <Rect anchors.fill="{parent}" color="gray" z="-1"/>
-</Item>
-
diff --git a/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp b/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp
index 4098a28..cce4df1 100644
--- a/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp
+++ b/tests/auto/declarative/simplecanvasitem/tst_simplecanvasitem.cpp
@@ -26,7 +26,7 @@ tst_SimpleCanvasItem::tst_SimpleCanvasItem()
void tst_SimpleCanvasItem::test_pos()
{
- QFxView *canvas = createView(SRCDIR "/data/test.xml");
+ QFxView *canvas = createView(SRCDIR "/data/test.qml");
canvas->execute();
qApp->processEvents();
QSimpleCanvasItem* root = qobject_cast<QSimpleCanvasItem*>(canvas->root());
@@ -42,7 +42,7 @@ void tst_SimpleCanvasItem::test_pos()
void tst_SimpleCanvasItem::test_scenePos()
{
- QFxView *canvas = createView(SRCDIR "/data/test.xml");
+ QFxView *canvas = createView(SRCDIR "/data/test.qml");
canvas->execute();
qApp->processEvents();
QSimpleCanvasItem* root = qobject_cast<QSimpleCanvasItem*>(canvas->root());