summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-22 08:24:05 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-22 08:24:05 (GMT)
commite2f90ecdde9550986df1539aa88eb5fc41d939e1 (patch)
tree354e192d83d1ed695373f085faa3a448e2599713 /tests
parent69b1784edb6dd82f26100d0e539bfa8a65bdd35d (diff)
parent33eb76f050b45718d87926a8ff7afc89d6201c16 (diff)
downloadQt-e2f90ecdde9550986df1539aa88eb5fc41d939e1.zip
Qt-e2f90ecdde9550986df1539aa88eb5fc41d939e1.tar.gz
Qt-e2f90ecdde9550986df1539aa88eb5fc41d939e1.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml: Replace QmlList* and QList* support with a single QmlListProperty type Rename MouseRegion -> MouseArea Update QmlChanges with animation API changes. Document the default velocity of EaseFollow Remove use of unexprted private classes. Fix compile error on Solaris Increase durations when testing Behaviors. Add cached path rounded rect painting benchmark. Remove use of direct event posting. Use QTest::keyClick() for keys.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/declarative.pro3
-rw-r--r--tests/auto/declarative/qmlanimations/data/badtype4.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/dotproperty.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/mixedtype1.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/mixedtype2.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/propertiesTransition.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml2
-rw-r--r--tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/binding.qml4
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/color.qml4
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/disabled.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/empty.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/explicit.qml4
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/groupProperty.qml4
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml4
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/parent.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml2
-rw-r--r--tests/auto/declarative/qmlbehaviors/data/simple.qml4
-rw-r--r--tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp30
-rw-r--r--tests/auto/declarative/qmldebug/tst_qmldebug.cpp2
-rw-r--r--tests/auto/declarative/qmlecmascript/data/listProperties.qml21
-rw-r--r--tests/auto/declarative/qmlecmascript/testtypes.h11
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp13
-rw-r--r--tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp30
-rw-r--r--tests/auto/declarative/qmlgraphicsmousearea/data/dragproperties.qml (renamed from tests/auto/declarative/qmlgraphicsmouseregion/data/dragproperties.qml)4
-rw-r--r--tests/auto/declarative/qmlgraphicsmousearea/qmlgraphicsmousearea.pro (renamed from tests/auto/declarative/qmlgraphicsmouseregion/qmlgraphicsmouseregion.pro)2
-rw-r--r--tests/auto/declarative/qmlgraphicsmousearea/tst_qmlgraphicsmousearea.cpp (renamed from tests/auto/declarative/qmlgraphicsmouseregion/tst_qmlgraphicsmouseregion.cpp)14
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp14
-rw-r--r--tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp8
-rw-r--r--tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp42
-rw-r--r--tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml7
-rw-r--r--tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/listAssignment.1.qml4
-rw-r--r--tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml2
-rw-r--r--tests/auto/declarative/qmllanguage/testtypes.h21
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp47
-rw-r--r--tests/auto/declarative/qmllist/data/MyType.qml5
-rw-r--r--tests/auto/declarative/qmllist/data/engineTypes.qml9
-rw-r--r--tests/auto/declarative/qmllist/data/variantToList.qml10
-rw-r--r--tests/auto/declarative/qmllist/tst_qmllist.cpp528
-rw-r--r--tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro5
-rw-r--r--tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp452
-rw-r--r--tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp35
-rw-r--r--tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp81
-rw-r--r--tests/auto/declarative/qmlstates/data/illegalTempState.qml2
-rw-r--r--tests/auto/declarative/qmlstates/data/legalTempState.qml2
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange.qml2
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange2.qml2
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange3.qml2
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange4.qml2
-rw-r--r--tests/auto/declarative/qmlstates/data/parentChange5.qml2
-rw-r--r--tests/auto/declarative/qmlstates/tst_qmlstates.cpp48
-rw-r--r--tests/auto/declarative/visual/Package_Views/packageviews.qml4
-rw-r--r--tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml6
-rw-r--r--tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml2
-rw-r--r--tests/auto/declarative/visual/animation/easing/easing.qml2
-rw-r--r--tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml2
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/parentAction.qml2
-rw-r--r--tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml2
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/reanchor.qml4
-rw-r--r--tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml2
-rw-r--r--tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml8
-rw-r--r--tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml2
-rw-r--r--tests/auto/declarative/visual/qmlmouseregion/drag.qml2
-rw-r--r--tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml14
-rw-r--r--tests/auto/declarative/visual/qmlspringfollow/follow.qml2
-rw-r--r--tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml2
-rw-r--r--tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml2
-rw-r--r--tests/benchmarks/declarative/painting/paintbenchmark.cpp24
-rw-r--r--tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml2
-rw-r--r--tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml2
-rw-r--r--tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml2
-rw-r--r--tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml2
-rw-r--r--tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml2
-rw-r--r--tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml2
81 files changed, 773 insertions, 842 deletions
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
index b4a0d0f..9dc7230 100644
--- a/tests/auto/declarative/declarative.pro
+++ b/tests/auto/declarative/declarative.pro
@@ -29,7 +29,7 @@ SUBDIRS += \
qmlgraphicsitem \ # Cover
qmlgraphicslistview \ # Cover
qmlgraphicsloader \ # Cover
- qmlgraphicsmouseregion \ # Cover
+ qmlgraphicsmousearea \ # Cover
qmlgraphicsparticles \ # Cover
qmlgraphicspathview \ # Cover
qmlgraphicspositioners \ # Cover
@@ -40,7 +40,6 @@ SUBDIRS += \
qmlinstruction \ # Cover
qmllanguage \ # Cover
qmllist \ # Cover
- qmllistaccessor \ # Cover
qmllistmodel \ # Cover
qmlmetaproperty \ # Cover
qmlmetatype \ # Cover
diff --git a/tests/auto/declarative/qmlanimations/data/badtype4.qml b/tests/auto/declarative/qmlanimations/data/badtype4.qml
index 2ffed37..e80762f 100644
--- a/tests/auto/declarative/qmlanimations/data/badtype4.qml
+++ b/tests/auto/declarative/qmlanimations/data/badtype4.qml
@@ -10,7 +10,7 @@ Rectangle {
color: "red"
width: 50; height: 50
x: 100; y: 100
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
}
diff --git a/tests/auto/declarative/qmlanimations/data/dotproperty.qml b/tests/auto/declarative/qmlanimations/data/dotproperty.qml
index 08bb5d8..9f0e699 100644
--- a/tests/auto/declarative/qmlanimations/data/dotproperty.qml
+++ b/tests/auto/declarative/qmlanimations/data/dotproperty.qml
@@ -9,7 +9,7 @@ Rectangle {
color: "red"
width: 50; height: 50
x: 100; y: 100
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
}
diff --git a/tests/auto/declarative/qmlanimations/data/mixedtype1.qml b/tests/auto/declarative/qmlanimations/data/mixedtype1.qml
index b46270c..6770366 100644
--- a/tests/auto/declarative/qmlanimations/data/mixedtype1.qml
+++ b/tests/auto/declarative/qmlanimations/data/mixedtype1.qml
@@ -10,7 +10,7 @@ Rectangle {
color: "red"
width: 50; height: 50
x: 100; y: 100
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
}
diff --git a/tests/auto/declarative/qmlanimations/data/mixedtype2.qml b/tests/auto/declarative/qmlanimations/data/mixedtype2.qml
index 15537f1..80c9473 100644
--- a/tests/auto/declarative/qmlanimations/data/mixedtype2.qml
+++ b/tests/auto/declarative/qmlanimations/data/mixedtype2.qml
@@ -10,7 +10,7 @@ Rectangle {
color: "red"
width: 50; height: 50
x: 100; y: 100
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1";
}
diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition.qml
index 2f7fd4a..b13b94b 100644
--- a/tests/auto/declarative/qmlanimations/data/propertiesTransition.qml
+++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition.qml
@@ -22,7 +22,7 @@ Rectangle {
NumberAnimation { targets: theRect; properties: "x" }
}
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: parent.state = "moved"
}
diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml
index ae59157..033c5c1 100644
--- a/tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml
+++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition2.qml
@@ -22,7 +22,7 @@ Rectangle {
NumberAnimation { target: theRect; property: "y"; to: 200 }
}
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: parent.state = "moved"
}
diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml
index 5aaaab8..d0704c9 100644
--- a/tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml
+++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition3.qml
@@ -22,7 +22,7 @@ Rectangle {
NumberAnimation { targets: theRect; properties: "y" }
}
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: parent.state = "moved"
}
diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml
index b7ebb1b..e70c95c 100644
--- a/tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml
+++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition4.qml
@@ -22,7 +22,7 @@ Rectangle {
NumberAnimation { target: theRect; properties: "x" }
}
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: parent.state = "moved"
}
diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml
index 9034fc5..b9e27da 100644
--- a/tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml
+++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition5.qml
@@ -22,7 +22,7 @@ Rectangle {
NumberAnimation { targets: theRect; property: "x" }
}
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: parent.state = "moved"
}
diff --git a/tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml b/tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml
index 3d8be51..7417ed1 100644
--- a/tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml
+++ b/tests/auto/declarative/qmlanimations/data/propertiesTransition6.qml
@@ -22,7 +22,7 @@ Rectangle {
NumberAnimation { targets: theItem; properties: "x" }
}
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: parent.state = "moved"
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/binding.qml b/tests/auto/declarative/qmlbehaviors/data/binding.qml
index e0c3321..201da37 100644
--- a/tests/auto/declarative/qmlbehaviors/data/binding.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/binding.qml
@@ -9,9 +9,9 @@ Rectangle {
objectName: "MyRect"
width: 100; height: 100; color: "green"
x: basex
- x: Behavior { NumberAnimation { duration: 200; } }
+ x: Behavior { NumberAnimation { duration: 500; } }
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/color.qml b/tests/auto/declarative/qmlbehaviors/data/color.qml
index 6598703..91dbbd1 100644
--- a/tests/auto/declarative/qmlbehaviors/data/color.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/color.qml
@@ -7,9 +7,9 @@ Rectangle {
objectName: "MyRect"
width: 100; height: 100;
color: "green"
- color: Behavior { ColorAnimation { duration: 200; } }
+ color: Behavior { ColorAnimation { duration: 500; } }
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml b/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml
index ba507c4..8d032f0 100644
--- a/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/cpptrigger.qml
@@ -6,6 +6,6 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior { NumberAnimation { duration: 200; } }
+ x: Behavior { NumberAnimation { duration: 500; } }
}
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/disabled.qml b/tests/auto/declarative/qmlbehaviors/data/disabled.qml
index e7b8d51..3c7078a 100644
--- a/tests/auto/declarative/qmlbehaviors/data/disabled.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/disabled.qml
@@ -12,7 +12,7 @@ Rectangle {
NumberAnimation { duration: 200; }
}
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/empty.qml b/tests/auto/declarative/qmlbehaviors/data/empty.qml
index 412e26c..95d934a 100644
--- a/tests/auto/declarative/qmlbehaviors/data/empty.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/empty.qml
@@ -8,7 +8,7 @@ Rectangle {
width: 100; height: 100; color: "green"
x: Behavior {}
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/explicit.qml b/tests/auto/declarative/qmlbehaviors/data/explicit.qml
index ba36d93..1b2025a 100644
--- a/tests/auto/declarative/qmlbehaviors/data/explicit.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/explicit.qml
@@ -8,10 +8,10 @@ Rectangle {
width: 100; height: 100; color: "green"
x: Behavior {
objectName: "MyBehavior";
- NumberAnimation { target: rect; property: "x"; duration: 200; }
+ NumberAnimation { target: rect; property: "x"; duration: 500; }
}
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml b/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml
index 4f127c1..14883d4 100644
--- a/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/groupProperty.qml
@@ -6,9 +6,9 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- pos: Behavior { PropertyAnimation { duration: 200; } }
+ pos: Behavior { PropertyAnimation { duration: 500; } }
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml b/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml
index 19d70b6..b43ddbc 100644
--- a/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/groupProperty2.qml
@@ -6,9 +6,9 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- pos.x: Behavior { NumberAnimation { duration: 200; } }
+ pos.x: Behavior { NumberAnimation { duration: 500; } }
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml b/tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml
index 59cbd1a..f267a05 100644
--- a/tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/nonSelecting2.qml
@@ -11,7 +11,7 @@ Rectangle {
NumberAnimation { targets: rect; properties: "y"; duration: 200; }
}
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/parent.qml b/tests/auto/declarative/qmlbehaviors/data/parent.qml
index 4f4911b..7c7fdcb 100644
--- a/tests/auto/declarative/qmlbehaviors/data/parent.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/parent.qml
@@ -8,7 +8,7 @@ Rectangle {
width: 100; height: 100; color: "green"
parent: Behavior {
SequentialAnimation {
- PauseAnimation { duration: 200 }
+ PauseAnimation { duration: 500 }
PropertyAction {}
}
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml
index 693a595..ba744b1 100644
--- a/tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/reassignedAnimation.qml
@@ -12,7 +12,7 @@ Rectangle {
NumberAnimation { duration: 1000 }
}
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml b/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml
index 4383a0b..a91ca88 100644
--- a/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/scripttrigger.qml
@@ -11,6 +11,6 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior { NumberAnimation { duration: 200; } }
+ x: Behavior { NumberAnimation { duration: 500; } }
}
}
diff --git a/tests/auto/declarative/qmlbehaviors/data/simple.qml b/tests/auto/declarative/qmlbehaviors/data/simple.qml
index 37c3915..ac98ed0 100644
--- a/tests/auto/declarative/qmlbehaviors/data/simple.qml
+++ b/tests/auto/declarative/qmlbehaviors/data/simple.qml
@@ -8,10 +8,10 @@ Rectangle {
width: 100; height: 100; color: "green"
x: Behavior {
objectName: "MyBehavior";
- NumberAnimation { duration: 200; }
+ NumberAnimation { duration: 500; }
}
}
- MouseRegion {
+ MouseArea {
id: clicker
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
index 99ec728..e31b600 100644
--- a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
+++ b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
@@ -79,7 +79,7 @@ void tst_qmlbehaviors::simpleBehavior()
QVERIFY(qobject_cast<QmlBehavior*>(rect->findChild<QmlBehavior*>("MyBehavior"))->animation());
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -92,7 +92,7 @@ void tst_qmlbehaviors::scriptTriggered()
QVERIFY(rect);
rect->setColor(QColor("red"));
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -108,7 +108,7 @@ void tst_qmlbehaviors::cppTriggered()
QVERIFY(innerRect);
innerRect->setProperty("x", 200);
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = innerRect->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -132,7 +132,7 @@ void tst_qmlbehaviors::colorBehavior()
QVERIFY(rect);
rect->setState("red");
- QTest::qWait(100);
+ QTest::qWait(200);
QColor color = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->color();
QVERIFY(color != QColor("red") && color != QColor("green")); //i.e. the behavior has been triggered
}
@@ -145,11 +145,11 @@ void tst_qmlbehaviors::parentBehavior()
QVERIFY(rect);
rect->setState("reparented");
- QTest::qWait(100);
+ QTest::qWait(200);
QmlGraphicsItem *newParent = rect->findChild<QmlGraphicsItem*>("NewParent");
QmlGraphicsItem *parent = rect->findChild<QmlGraphicsRectangle*>("MyRect")->parentItem();
QVERIFY(parent != newParent);
- QTest::qWait(300);
+ QTest::qWait(600);
parent = rect->findChild<QmlGraphicsRectangle*>("MyRect")->parentItem();
QVERIFY(parent == newParent);
}
@@ -162,29 +162,29 @@ void tst_qmlbehaviors::replaceBinding()
QVERIFY(rect);
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"));
QVERIFY(innerRect);
qreal x = innerRect->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
- QTest::qWait(300);
+ QTest::qWait(600);
QCOMPARE(innerRect->x(), (qreal)200);
rect->setProperty("basex", 10);
QCOMPARE(innerRect->x(), (qreal)200);
rect->setProperty("movedx", 210);
- QTest::qWait(300);
+ QTest::qWait(600);
QCOMPARE(innerRect->x(), (qreal)210);
rect->setState("");
- QTest::qWait(100);
+ QTest::qWait(200);
x = innerRect->x();
QVERIFY(x > 10 && x < 210); //i.e. the behavior has been triggered
- QTest::qWait(300);
+ QTest::qWait(600);
QCOMPARE(innerRect->x(), (qreal)10);
rect->setProperty("movedx", 200);
QCOMPARE(innerRect->x(), (qreal)10);
rect->setProperty("basex", 20);
- QTest::qWait(300);
+ QTest::qWait(600);
QCOMPARE(innerRect->x(), (qreal)20);
}
@@ -197,7 +197,7 @@ void tst_qmlbehaviors::group()
QVERIFY(rect);
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -209,7 +209,7 @@ void tst_qmlbehaviors::group()
QVERIFY(rect);
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
@@ -236,7 +236,7 @@ void tst_qmlbehaviors::explicitSelection()
QVERIFY(rect);
rect->setState("moved");
- QTest::qWait(100);
+ QTest::qWait(200);
qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
QVERIFY(x > 0 && x < 200); //i.e. the behavior has been triggered
}
diff --git a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp
index 2e668ad..ba07331 100644
--- a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp
+++ b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp
@@ -825,7 +825,7 @@ int main(int argc, char *argv[])
"width: 10; height: 20; scale: blueRect.scale;"
"Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }"
"Text { color: blueRect.color; }"
- "MouseRegion {"
+ "MouseArea {"
"onEntered: { console.log('hello') }"
"}"
"}";
diff --git a/tests/auto/declarative/qmlecmascript/data/listProperties.qml b/tests/auto/declarative/qmlecmascript/data/listProperties.qml
index cae1721..810f9b6 100644
--- a/tests/auto/declarative/qmlecmascript/data/listProperties.qml
+++ b/tests/auto/declarative/qmlecmascript/data/listProperties.qml
@@ -9,12 +9,6 @@ MyQmlObject {
QtObject { property int a: 11 }
]
- objectQmlListProperty: [
- QtObject { property int a: 10 },
- QtObject { property int a: 1 },
- QtObject { property int a: 39 }
- ]
-
Script {
function calcTest1() {
var rv = 0;
@@ -24,21 +18,10 @@ MyQmlObject {
return rv;
}
- function calcTest2() {
- var rv = 0;
- for (var ii = 0; ii < root.objectQmlListProperty.length; ++ii) {
- rv += root.objectQmlListProperty[ii].a;
- }
- return rv;
- }
}
property int test1: calcTest1();
property int test2: root.objectListProperty.length
- property int test3: calcTest2();
- property int test4: root.objectQmlListProperty.length
- property bool test5: root.objectQmlListProperty[1] != undefined
- property bool test6: root.objectQmlListProperty[100] == undefined
- property bool test7: root.objectListProperty[1] != undefined
- property bool test8: root.objectListProperty[100] == undefined
+ property bool test3: root.objectListProperty[1] != undefined
+ property bool test4: root.objectListProperty[100] == undefined
}
diff --git a/tests/auto/declarative/qmlecmascript/testtypes.h b/tests/auto/declarative/qmlecmascript/testtypes.h
index 330664f..0af72cb 100644
--- a/tests/auto/declarative/qmlecmascript/testtypes.h
+++ b/tests/auto/declarative/qmlecmascript/testtypes.h
@@ -77,8 +77,7 @@ class MyQmlObject : public QObject
Q_PROPERTY(int value READ value WRITE setValue)
Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged)
Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged)
- Q_PROPERTY(QmlList<QObject *> *objectQmlListProperty READ objectQmlListProperty CONSTANT)
- Q_PROPERTY(QList<QObject *> *objectListProperty READ objectListProperty CONSTANT)
+ Q_PROPERTY(QmlListProperty<QObject> objectListProperty READ objectListProperty CONSTANT)
Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty)
public:
@@ -107,8 +106,7 @@ public:
emit objectChanged();
}
- QmlList<QObject *> *objectQmlListProperty() { return &m_objectQmlList; }
- QList<QObject *> *objectListProperty() { return &m_objectQList; }
+ QmlListProperty<QObject> objectListProperty() { return QmlListProperty<QObject>(this, m_objectQList); }
bool methodCalled() const { return m_methodCalled; }
bool methodIntCalled() const { return m_methodIntCalled; }
@@ -150,7 +148,6 @@ private:
QObject *m_object;
QString m_string;
- QmlConcreteList<QObject *> m_objectQmlList;
QList<QObject *> m_objectQList;
int m_value;
int m_resetProperty;
@@ -162,11 +159,11 @@ QML_DECLARE_TYPE(MyQmlObject);
class MyQmlContainer : public QObject
{
Q_OBJECT
- Q_PROPERTY(QList<MyQmlObject*>* children READ children CONSTANT)
+ Q_PROPERTY(QmlListProperty<MyQmlObject> children READ children CONSTANT)
public:
MyQmlContainer() {}
- QList<MyQmlObject*> *children() { return &m_children; }
+ QmlListProperty<MyQmlObject> children() { return QmlListProperty<MyQmlObject>(this, m_children); }
private:
QList<MyQmlObject*> m_children;
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index 0ef836f..b30ad1c 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -365,7 +365,6 @@ void tst_qmlecmascript::basicExpressions()
QCOMPARE(expr.value(), result);
}
-Q_DECLARE_METATYPE(QList<QObject *>);
void tst_qmlecmascript::arrayExpressions()
{
QObject obj1;
@@ -985,12 +984,8 @@ void tst_qmlecmascript::listProperties()
QCOMPARE(object->property("test1").toInt(), 21);
QCOMPARE(object->property("test2").toInt(), 2);
- QCOMPARE(object->property("test3").toInt(), 50);
- QCOMPARE(object->property("test4").toInt(), 3);
- QCOMPARE(object->property("test5").toBool(), true);
- QCOMPARE(object->property("test6").toBool(), true);
- QCOMPARE(object->property("test7").toBool(), true);
- QCOMPARE(object->property("test8").toBool(), true);
+ QCOMPARE(object->property("test3").toBool(), true);
+ QCOMPARE(object->property("test4").toBool(), true);
}
void tst_qmlecmascript::exceptionClearsOnReeval()
@@ -1612,7 +1607,9 @@ void tst_qmlecmascript::listToVariant()
QObject *object = component.create(&context);
QVERIFY(object != 0);
- QCOMPARE(object->property("test"), QVariant::fromValue(container.children()));
+ QVariant v = object->property("test");
+ QCOMPARE(v.userType(), qMetaTypeId<QmlListReference>());
+ QVERIFY(qvariant_cast<QmlListReference>(v).object() == &container);
delete object;
}
diff --git a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
index 00127e5..2520d4a 100644
--- a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
+++ b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp
@@ -645,45 +645,29 @@ void tst_QmlGraphicsGridView::currentIndex()
QCOMPARE(gridview->viewportY(), 0.0);
// Test keys
+ qApp->setActiveWindow(canvas);
canvas->show();
canvas->setFocus();
qApp->processEvents();
- QEvent wa(QEvent::WindowActivate);
- QApplication::sendEvent(canvas, &wa);
- QFocusEvent fe(QEvent::FocusIn);
- QApplication::sendEvent(canvas, &fe);
-
- QKeyEvent key(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Down);
QCOMPARE(gridview->currentIndex(), 3);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Up);
QCOMPARE(gridview->currentIndex(), 0);
gridview->setFlow(QmlGraphicsGridView::TopToBottom);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Right);
QCOMPARE(gridview->currentIndex(), 5);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Left);
QCOMPARE(gridview->currentIndex(), 0);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Down);
QCOMPARE(gridview->currentIndex(), 1);
- key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
- QApplication::sendEvent(canvas, &key);
- QVERIFY(key.isAccepted());
+ QTest::keyClick(canvas, Qt::Key_Up);
QCOMPARE(gridview->currentIndex(), 0);
diff --git a/tests/auto/declarative/qmlgraphicsmouseregion/data/dragproperties.qml b/tests/auto/declarative/qmlgraphicsmousearea/data/dragproperties.qml
index 5acb3e4..4cd78da 100644
--- a/tests/auto/declarative/qmlgraphicsmouseregion/data/dragproperties.qml
+++ b/tests/auto/declarative/qmlgraphicsmousearea/data/dragproperties.qml
@@ -14,7 +14,7 @@ Rectangle {
height: 100
opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200
Text { text: blackRect.opacity}
- MouseRegion {
+ MouseArea {
objectName: "mouseregion"
anchors.fill: parent
drag.target: blackRect
@@ -25,4 +25,4 @@ Rectangle {
drag.maximumY: whiteRect.height-blackRect.height
}
}
- } \ No newline at end of file
+ }
diff --git a/tests/auto/declarative/qmlgraphicsmouseregion/qmlgraphicsmouseregion.pro b/tests/auto/declarative/qmlgraphicsmousearea/qmlgraphicsmousearea.pro
index 7a7c8bd..f85bf0f 100644
--- a/tests/auto/declarative/qmlgraphicsmouseregion/qmlgraphicsmouseregion.pro
+++ b/tests/auto/declarative/qmlgraphicsmousearea/qmlgraphicsmousearea.pro
@@ -3,7 +3,7 @@ contains(QT_CONFIG,declarative): QT += declarative gui network
macx:CONFIG -= app_bundle
HEADERS += ../shared/testhttpserver.h
-SOURCES += tst_qmlgraphicsmouseregion.cpp ../shared/testhttpserver.cpp
+SOURCES += tst_qmlgraphicsmousearea.cpp ../shared/testhttpserver.cpp
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/declarative/qmlgraphicsmouseregion/tst_qmlgraphicsmouseregion.cpp b/tests/auto/declarative/qmlgraphicsmousearea/tst_qmlgraphicsmousearea.cpp
index 82da9c8..869a7bd 100644
--- a/tests/auto/declarative/qmlgraphicsmouseregion/tst_qmlgraphicsmouseregion.cpp
+++ b/tests/auto/declarative/qmlgraphicsmousearea/tst_qmlgraphicsmousearea.cpp
@@ -41,10 +41,10 @@
#include <QtTest/QtTest>
#include <QtTest/QSignalSpy>
-#include <private/qmlgraphicsmouseregion_p.h>
+#include <private/qmlgraphicsmousearea_p.h>
#include <QtDeclarative/qmlview.h>
-class tst_QmlGraphicsMouseRegion: public QObject
+class tst_QmlGraphicsMouseArea: public QObject
{
Q_OBJECT
private slots:
@@ -53,7 +53,7 @@ private:
QmlView *createView(const QString &filename);
};
-void tst_QmlGraphicsMouseRegion::dragProperties()
+void tst_QmlGraphicsMouseArea::dragProperties()
{
QmlView *canvas = createView(SRCDIR "/data/dragproperties.qml");
canvas->execute();
@@ -61,7 +61,7 @@ void tst_QmlGraphicsMouseRegion::dragProperties()
canvas->setFocus();
QVERIFY(canvas->rootObject() != 0);
- QmlGraphicsMouseRegion *mouseRegion = canvas->rootObject()->findChild<QmlGraphicsMouseRegion*>("mouseregion");
+ QmlGraphicsMouseArea *mouseRegion = canvas->rootObject()->findChild<QmlGraphicsMouseArea*>("mouseregion");
QmlGraphicsDrag *drag = mouseRegion->drag();
QVERIFY(mouseRegion != 0);
QVERIFY(drag != 0);
@@ -124,7 +124,7 @@ void tst_QmlGraphicsMouseRegion::dragProperties()
QCOMPARE(ymaxSpy.count(),1);
}
-QmlView *tst_QmlGraphicsMouseRegion::createView(const QString &filename)
+QmlView *tst_QmlGraphicsMouseArea::createView(const QString &filename)
{
QmlView *canvas = new QmlView(0);
canvas->setFixedSize(240,320);
@@ -134,6 +134,6 @@ QmlView *tst_QmlGraphicsMouseRegion::createView(const QString &filename)
return canvas;
}
-QTEST_MAIN(tst_QmlGraphicsMouseRegion)
+QTEST_MAIN(tst_QmlGraphicsMouseArea)
-#include "tst_qmlgraphicsmouseregion.moc"
+#include "tst_qmlgraphicsmousearea.moc"
diff --git a/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp b/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp
index 072f740..b986a64 100644
--- a/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp
+++ b/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp
@@ -268,31 +268,31 @@ void tst_QmlGraphicsPathView::path()
QCOMPARE(obj->startY(), 100.);
QVERIFY(obj->path() != QPainterPath());
- QList<QmlGraphicsPathElement*> *list = obj->pathElements();
- QCOMPARE(list->count(), 5);
+ QmlListReference list(obj, "pathElements");
+ QCOMPARE(list.count(), 5);
- QmlGraphicsPathAttribute* attr = qobject_cast<QmlGraphicsPathAttribute*>(list->at(0));
+ QmlGraphicsPathAttribute* attr = qobject_cast<QmlGraphicsPathAttribute*>(list.at(0));
QVERIFY(attr != 0);
QCOMPARE(attr->name(), QString("scale"));
QCOMPARE(attr->value(), 1.0);
- QmlGraphicsPathQuad* quad = qobject_cast<QmlGraphicsPathQuad*>(list->at(1));
+ QmlGraphicsPathQuad* quad = qobject_cast<QmlGraphicsPathQuad*>(list.at(1));
QVERIFY(quad != 0);
QCOMPARE(quad->x(), 120.);
QCOMPARE(quad->y(), 25.);
QCOMPARE(quad->controlX(), 260.);
QCOMPARE(quad->controlY(), 75.);
- QmlGraphicsPathPercent* perc = qobject_cast<QmlGraphicsPathPercent*>(list->at(2));
+ QmlGraphicsPathPercent* perc = qobject_cast<QmlGraphicsPathPercent*>(list.at(2));
QVERIFY(perc != 0);
QCOMPARE(perc->value(), 0.3);
- QmlGraphicsPathLine* line = qobject_cast<QmlGraphicsPathLine*>(list->at(3));
+ QmlGraphicsPathLine* line = qobject_cast<QmlGraphicsPathLine*>(list.at(3));
QVERIFY(line != 0);
QCOMPARE(line->x(), 120.);
QCOMPARE(line->y(), 100.);
- QmlGraphicsPathCubic* cubic = qobject_cast<QmlGraphicsPathCubic*>(list->at(4));
+ QmlGraphicsPathCubic* cubic = qobject_cast<QmlGraphicsPathCubic*>(list.at(4));
QVERIFY(cubic != 0);
QCOMPARE(cubic->x(), 180.);
QCOMPARE(cubic->y(), 0.);
diff --git a/tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp b/tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp
index 9e3a028..c971840 100644
--- a/tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp
+++ b/tests/auto/declarative/qmlgraphicsrepeater/tst_qmlgraphicsrepeater.cpp
@@ -188,14 +188,14 @@ void tst_QmlGraphicsRepeater::objectList()
{
QmlView *canvas = createView(SRCDIR "/data/objlist.qml");
- QObjectList* data = new QObjectList;
+ QObjectList data;
for(int i=0; i<100; i++){
- *data << new QObject();
- data->back()->setProperty("idx", i);
+ data << new QObject();
+ data.back()->setProperty("idx", i);
}
QmlContext *ctxt = canvas->rootContext();
- ctxt->setContextProperty("testData", QVariant::fromValue<QObjectList*>(data));
+ ctxt->setContextProperty("testData", QVariant::fromValue(data));
canvas->execute();
qApp->processEvents();
diff --git a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp
index 9c753ce..38d024a 100644
--- a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp
+++ b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp
@@ -421,13 +421,6 @@ void tst_qmlinstruction::dump()
{
QmlInstruction i;
- i.line = 37;
- i.type = QmlInstruction::StoreObjectQmlList;
- data->bytecode << i;
- }
-
- {
- QmlInstruction i;
i.line = 38;
i.type = QmlInstruction::StoreObjectQList;
data->bytecode << i;
@@ -450,15 +443,6 @@ void tst_qmlinstruction::dump()
{
QmlInstruction i;
- i.line = 41;
- i.type = QmlInstruction::FetchQmlList;
- i.fetchQmlList.property = 31;
- i.fetchQmlList.type = 3;
- data->bytecode << i;
- }
-
- {
- QmlInstruction i;
i.line = 42;
i.type = QmlInstruction::FetchQList;
i.fetch.property = 32;
@@ -569,20 +553,18 @@ void tst_qmlinstruction::dump()
<< "34\t\t34\tSTORE_VALUE_SOURCE\t29\t4"
<< "35\t\t35\tSTORE_VALUE_INTERCEPTOR\t30\t-4"
<< "36\t\t36\tBEGIN\t\t\t4"
- << "37\t\t37\tSTORE_OBJECT_QMLLIST"
- << "38\t\t38\tSTORE_OBJECT_QLIST"
- << "39\t\t39\tASSIGN_OBJECT_LIST"
- << "40\t\t40\tFETCH_ATTACHED\t\t23"
- << "41\t\t41\tFETCH_QMLLIST\t\t31\t3"
- << "42\t\t42\tFETCH_QLIST\t\t32"
- << "43\t\t43\tFETCH\t\t\t33"
- << "44\t\t44\tFETCH_VALUE\t\t34\t6"
- << "45\t\t45\tPOP"
- << "46\t\t46\tPOP_QLIST"
- << "47\t\t47\tPOP_VALUE\t\t35\t8"
- << "48\t\t48\tDEFER\t\t\t7"
- << "49\t\tNA\tDEFER\t\t\t7"
- << "50\t\t50\tXXX UNKOWN INSTRUCTION\t49"
+ << "37\t\t38\tSTORE_OBJECT_QLIST"
+ << "38\t\t39\tASSIGN_OBJECT_LIST"
+ << "39\t\t40\tFETCH_ATTACHED\t\t23"
+ << "40\t\t42\tFETCH_QLIST\t\t32"
+ << "41\t\t43\tFETCH\t\t\t33"
+ << "42\t\t44\tFETCH_VALUE\t\t34\t6"
+ << "43\t\t45\tPOP"
+ << "44\t\t46\tPOP_QLIST"
+ << "45\t\t47\tPOP_VALUE\t\t35\t8"
+ << "46\t\t48\tDEFER\t\t\t7"
+ << "47\t\tNA\tDEFER\t\t\t7"
+ << "48\t\t50\tXXX UNKOWN INSTRUCTION\t47"
<< "-------------------------------------------------------------------------------";
messages = QStringList();
diff --git a/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml b/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml
deleted file mode 100644
index 8392bea..0000000
--- a/tests/auto/declarative/qmllanguage/data/interfaceQmlList.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-import Test 1.0
-MyContainer {
- qmllistInterfaces: [
- MyQmlObject {},
- MyQmlObject {}
- ]
-}
diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt b/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt
deleted file mode 100644
index d68d487..0000000
--- a/tests/auto/declarative/qmllanguage/data/listAssignment.1.errors.txt
+++ /dev/null
@@ -1 +0,0 @@
-3:24:Cannot assign primitives to lists
diff --git a/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml b/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml
deleted file mode 100644
index 4240425..0000000
--- a/tests/auto/declarative/qmllanguage/data/listAssignment.1.qml
+++ /dev/null
@@ -1,4 +0,0 @@
-import Test 1.0
-MyContainer {
- qmllistInterfaces: 1
-}
diff --git a/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml
index 779c6d4..32b5b6c 100644
--- a/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml
+++ b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml
@@ -23,7 +23,7 @@ Item {
width: 200; height: 50
Text { text: name }
Text { text: '$'+cost; anchors.right: parent.right }
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: fruitModel.remove(index)
}
diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h
index 0dc957f..27b45e4 100644
--- a/tests/auto/declarative/qmllanguage/testtypes.h
+++ b/tests/auto/declarative/qmllanguage/testtypes.h
@@ -447,22 +447,19 @@ QML_DECLARE_TYPE(MyTypeObject);
class MyContainer : public QObject
{
Q_OBJECT
- Q_PROPERTY(QList<QObject*>* children READ children)
- Q_PROPERTY(QList<MyInterface*>* qlistInterfaces READ qlistInterfaces)
- Q_PROPERTY(QmlList<MyInterface*>* qmllistInterfaces READ qmllistInterfaces)
+ Q_PROPERTY(QmlListProperty<QObject> children READ children)
+ Q_PROPERTY(QmlListProperty<MyInterface> qlistInterfaces READ qlistInterfaces)
Q_CLASSINFO("DefaultProperty", "children");
public:
MyContainer() {}
- QList<QObject*> *children() { return &m_children; }
- QList<MyInterface *> *qlistInterfaces() { return &m_interfaces; }
- QmlList<MyInterface *> *qmllistInterfaces() { return &m_qmlinterfaces; }
- const QmlConcreteList<MyInterface *> &qmllistAccessor() const { return m_qmlinterfaces; }
+ QmlListProperty<QObject> children() { return QmlListProperty<QObject>(this, m_children); }
+ QList<QObject *> *getChildren() { return &m_children; }
+ QmlListProperty<MyInterface> qlistInterfaces() { return QmlListProperty<MyInterface>(this, m_interfaces); }
+ QList<MyInterface *> *getQListInterfaces() { return &m_interfaces; }
-private:
QList<QObject*> m_children;
QList<MyInterface *> m_interfaces;
- QmlConcreteList<MyInterface *> m_qmlinterfaces;
};
QML_DECLARE_TYPE(MyContainer);
@@ -534,12 +531,12 @@ namespace MyNamespace {
class MySecondNamespacedType : public QObject
{
Q_OBJECT
- Q_PROPERTY(QmlList<MyNamespace::MyNamespacedType *> *list READ list);
+ Q_PROPERTY(QmlListProperty<MyNamespace::MyNamespacedType> list READ list);
public:
- QmlList<MyNamespacedType *> *list() { return &m_list; }
+ QmlListProperty<MyNamespacedType> list() { return QmlListProperty<MyNamespacedType>(this, m_list); }
private:
- QmlConcreteList<MyNamespacedType *> m_list;
+ QList<MyNamespacedType *> m_list;
};
}
QML_DECLARE_TYPE(MyNamespace::MyNamespacedType);
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index c4636f3..4090e1d 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -76,7 +76,6 @@ private slots:
void simpleObject();
void simpleContainer();
void interfaceProperty();
- void interfaceQmlList();
void interfaceQList();
void assignObjectToSignal();
void assignObjectToVariant();
@@ -233,7 +232,6 @@ void tst_qmllanguage::errors_data()
QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false;
QTest::newRow("readOnly.3") << "readOnly.3.qml" << "readOnly.3.errors.txt" << false;
- QTest::newRow("listAssignment.1") << "listAssignment.1.qml" << "listAssignment.1.errors.txt" << false;
QTest::newRow("listAssignment.2") << "listAssignment.2.qml" << "listAssignment.2.errors.txt" << false;
QTest::newRow("listAssignment.3") << "listAssignment.3.qml" << "listAssignment.3.errors.txt" << false;
@@ -354,7 +352,7 @@ void tst_qmllanguage::simpleContainer()
VERIFY_ERRORS(0);
MyContainer *container= qobject_cast<MyContainer*>(component.create());
QVERIFY(container != 0);
- QCOMPARE(container->children()->count(),2);
+ QCOMPARE(container->getChildren()->count(),2);
}
void tst_qmllanguage::interfaceProperty()
@@ -367,26 +365,15 @@ void tst_qmllanguage::interfaceProperty()
QVERIFY(object->interface()->id == 913);
}
-void tst_qmllanguage::interfaceQmlList()
-{
- QmlComponent component(&engine, TEST_FILE("interfaceQmlList.qml"));
- VERIFY_ERRORS(0);
- MyContainer *container= qobject_cast<MyContainer*>(component.create());
- QVERIFY(container != 0);
- QVERIFY(container->qmllistAccessor().count() == 2);
- for(int ii = 0; ii < 2; ++ii)
- QVERIFY(container->qmllistAccessor().at(ii)->id == 913);
-}
-
void tst_qmllanguage::interfaceQList()
{
QmlComponent component(&engine, TEST_FILE("interfaceQList.qml"));
VERIFY_ERRORS(0);
MyContainer *container= qobject_cast<MyContainer*>(component.create());
QVERIFY(container != 0);
- QVERIFY(container->qlistInterfaces()->count() == 2);
+ QVERIFY(container->getQListInterfaces()->count() == 2);
for(int ii = 0; ii < 2; ++ii)
- QVERIFY(container->qlistInterfaces()->at(ii)->id == 913);
+ QVERIFY(container->getQListInterfaces()->at(ii)->id == 913);
}
void tst_qmllanguage::assignObjectToSignal()
@@ -425,8 +412,8 @@ void tst_qmllanguage::assignQmlComponent()
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
- QVERIFY(object->children()->count() == 1);
- QObject *child = object->children()->at(0);
+ QVERIFY(object->getChildren()->count() == 1);
+ QObject *child = object->getChildren()->at(0);
QCOMPARE(child->property("x"), QVariant(10));
QCOMPARE(child->property("y"), QVariant(11));
}
@@ -504,7 +491,7 @@ void tst_qmllanguage::rootAsQmlComponent()
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->property("x"), QVariant(11));
- QCOMPARE(object->children()->count(), 2);
+ QCOMPARE(object->getChildren()->count(), 2);
}
// Tests that components can be specified inline
@@ -514,8 +501,8 @@ void tst_qmllanguage::inlineQmlComponents()
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
- QCOMPARE(object->children()->count(), 1);
- QmlComponent *comp = qobject_cast<QmlComponent *>(object->children()->at(0));
+ QCOMPARE(object->getChildren()->count(), 1);
+ QmlComponent *comp = qobject_cast<QmlComponent *>(object->getChildren()->at(0));
QVERIFY(comp != 0);
MyQmlObject *compObject = qobject_cast<MyQmlObject *>(comp->create());
QVERIFY(compObject != 0);
@@ -529,9 +516,9 @@ void tst_qmllanguage::idProperty()
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
- QCOMPARE(object->children()->count(), 1);
+ QCOMPARE(object->getChildren()->count(), 1);
MyTypeObject *child =
- qobject_cast<MyTypeObject *>(object->children()->at(0));
+ qobject_cast<MyTypeObject *>(object->getChildren()->at(0));
QVERIFY(child != 0);
QCOMPARE(child->id(), QString("myObjectId"));
QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child));
@@ -1034,13 +1021,13 @@ void tst_qmllanguage::defaultPropertyListOrder()
MyContainer *container = qobject_cast<MyContainer *>(component.create());
QVERIFY(container != 0);
- QCOMPARE(container->children()->count(), 6);
- QCOMPARE(container->children()->at(0)->property("index"), QVariant(0));
- QCOMPARE(container->children()->at(1)->property("index"), QVariant(1));
- QCOMPARE(container->children()->at(2)->property("index"), QVariant(2));
- QCOMPARE(container->children()->at(3)->property("index"), QVariant(3));
- QCOMPARE(container->children()->at(4)->property("index"), QVariant(4));
- QCOMPARE(container->children()->at(5)->property("index"), QVariant(5));
+ QCOMPARE(container->getChildren()->count(), 6);
+ QCOMPARE(container->getChildren()->at(0)->property("index"), QVariant(0));
+ QCOMPARE(container->getChildren()->at(1)->property("index"), QVariant(1));
+ QCOMPARE(container->getChildren()->at(2)->property("index"), QVariant(2));
+ QCOMPARE(container->getChildren()->at(3)->property("index"), QVariant(3));
+ QCOMPARE(container->getChildren()->at(4)->property("index"), QVariant(4));
+ QCOMPARE(container->getChildren()->at(5)->property("index"), QVariant(5));
}
void tst_qmllanguage::declaredPropertyValues()
diff --git a/tests/auto/declarative/qmllist/data/MyType.qml b/tests/auto/declarative/qmllist/data/MyType.qml
new file mode 100644
index 0000000..d08f35b
--- /dev/null
+++ b/tests/auto/declarative/qmllist/data/MyType.qml
@@ -0,0 +1,5 @@
+import Qt 4.6
+
+QtObject {
+ property int a
+}
diff --git a/tests/auto/declarative/qmllist/data/engineTypes.qml b/tests/auto/declarative/qmllist/data/engineTypes.qml
new file mode 100644
index 0000000..670aee4
--- /dev/null
+++ b/tests/auto/declarative/qmllist/data/engineTypes.qml
@@ -0,0 +1,9 @@
+import Qt 4.6
+
+QtObject {
+ property list<MyType> myList
+
+ myList: [ MyType { a: 1 },
+ MyType { a: 9 } ]
+
+}
diff --git a/tests/auto/declarative/qmllist/data/variantToList.qml b/tests/auto/declarative/qmllist/data/variantToList.qml
new file mode 100644
index 0000000..0c2d0aa
--- /dev/null
+++ b/tests/auto/declarative/qmllist/data/variantToList.qml
@@ -0,0 +1,10 @@
+import Qt 4.6
+
+QtObject {
+ property list<QtObject> myList;
+ myList: QtObject {}
+
+ property var value: myList
+ property int test: value.length
+}
+
diff --git a/tests/auto/declarative/qmllist/tst_qmllist.cpp b/tests/auto/declarative/qmllist/tst_qmllist.cpp
index 4ffbbb8..76def1c 100644
--- a/tests/auto/declarative/qmllist/tst_qmllist.cpp
+++ b/tests/auto/declarative/qmllist/tst_qmllist.cpp
@@ -38,9 +38,27 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include <qtest.h>
+#include <QUrl>
+#include <QFileInfo>
+#include <QDir>
+#include <QmlEngine>
+#include <QmlComponent>
#include <QtDeclarative/qml.h>
#include <QtDeclarative/qmlprivate.h>
+#include <QDebug>
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ QFileInfo fileInfo(__FILE__);
+ return QUrl::fromLocalFile(fileInfo.absoluteDir().filePath("data/" + filename));
+}
+
+inline QUrl TEST_FILE(const char *filename)
+{
+ return TEST_FILE(QLatin1String(filename));
+}
class tst_QmlList : public QObject
{
@@ -49,28 +67,506 @@ public:
tst_QmlList() {}
private slots:
- void interface();
+ void qmllistreference();
+ void qmllistreference_invalid();
+ void isValid();
+ void object();
+ void listElementType();
+ void canAppend();
+ void canAt();
+ void canClear();
+ void canCount();
+ void append();
+ void at();
+ void clear();
+ void count();
+ void copy();
+ void qmlmetaproperty();
+ void engineTypes();
+ void variantToList();
};
-void tst_QmlList::interface()
+class TestType : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QmlListProperty<TestType> data READ dataProperty);
+ Q_PROPERTY(int intProperty READ intProperty);
+
+public:
+ TestType() : property(this, data) {}
+ QmlListProperty<TestType> dataProperty() { return property; }
+ int intProperty() const { return 10; }
+
+ QList<TestType *> data;
+ QmlListProperty<TestType> property;
+};
+QML_DECLARE_TYPE(TestType);
+QML_DEFINE_NOCREATE_TYPE(TestType);
+
+void tst_QmlList::qmllistreference()
+{
+ TestType tt;
+
+ QmlListReference r(&tt, "data");
+ QVERIFY(r.isValid() == true);
+ QCOMPARE(r.count(), 0);
+
+ tt.data.append(&tt);
+ QCOMPARE(r.count(), 1);
+}
+
+void tst_QmlList::qmllistreference_invalid()
+{
+ TestType tt;
+
+ // Invalid
+ {
+ QmlListReference r;
+ QVERIFY(r.isValid() == false);
+ QVERIFY(r.object() == 0);
+ QVERIFY(r.listElementType() == 0);
+ QVERIFY(r.canAt() == false);
+ QVERIFY(r.canClear() == false);
+ QVERIFY(r.canCount() == false);
+ QVERIFY(r.append(0) == false);
+ QVERIFY(r.at(10) == 0);
+ QVERIFY(r.clear() == false);
+ QVERIFY(r.count() == 0);
+ }
+
+ // Non-property
+ {
+ QmlListReference r(&tt, "blah");
+ QVERIFY(r.isValid() == false);
+ QVERIFY(r.object() == 0);
+ QVERIFY(r.listElementType() == 0);
+ QVERIFY(r.canAt() == false);
+ QVERIFY(r.canClear() == false);
+ QVERIFY(r.canCount() == false);
+ QVERIFY(r.append(0) == false);
+ QVERIFY(r.at(10) == 0);
+ QVERIFY(r.clear() == false);
+ QVERIFY(r.count() == 0);
+ }
+
+ // Non-list property
+ {
+ QmlListReference r(&tt, "intProperty");
+ QVERIFY(r.isValid() == false);
+ QVERIFY(r.object() == 0);
+ QVERIFY(r.listElementType() == 0);
+ QVERIFY(r.canAt() == false);
+ QVERIFY(r.canClear() == false);
+ QVERIFY(r.canCount() == false);
+ QVERIFY(r.append(0) == false);
+ QVERIFY(r.at(10) == 0);
+ QVERIFY(r.clear() == false);
+ QVERIFY(r.count() == 0);
+ }
+}
+
+void tst_QmlList::isValid()
+{
+ TestType *tt = new TestType;
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.isValid() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.isValid() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.isValid() == true);
+ delete tt;
+ QVERIFY(ref.isValid() == false);
+ }
+}
+
+void tst_QmlList::object()
+{
+ TestType *tt = new TestType;
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.object() == 0);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.object() == 0);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.object() == tt);
+ delete tt;
+ QVERIFY(ref.object() == 0);
+ }
+}
+
+void tst_QmlList::listElementType()
+{
+ TestType *tt = new TestType;
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.listElementType() == 0);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.listElementType() == 0);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.listElementType() == &TestType::staticMetaObject);
+ delete tt;
+ QVERIFY(ref.listElementType() == 0);
+ }
+}
+
+void tst_QmlList::canAppend()
+{
+ TestType *tt = new TestType;
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.canAppend() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.canAppend() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.canAppend() == true);
+ delete tt;
+ QVERIFY(ref.canAppend() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.append = 0;
+ QmlListReference ref(&tt, "data");
+ QVERIFY(ref.canAppend() == false);
+ }
+}
+
+void tst_QmlList::canAt()
+{
+ TestType *tt = new TestType;
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.canAt() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.canAt() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.canAt() == true);
+ delete tt;
+ QVERIFY(ref.canAt() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.at = 0;
+ QmlListReference ref(&tt, "data");
+ QVERIFY(ref.canAt() == false);
+ }
+}
+
+void tst_QmlList::canClear()
+{
+ TestType *tt = new TestType;
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.canClear() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.canClear() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.canClear() == true);
+ delete tt;
+ QVERIFY(ref.canClear() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.clear = 0;
+ QmlListReference ref(&tt, "data");
+ QVERIFY(ref.canClear() == false);
+ }
+}
+
+void tst_QmlList::canCount()
+{
+ TestType *tt = new TestType;
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.canCount() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.canCount() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.canCount() == true);
+ delete tt;
+ QVERIFY(ref.canCount() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.count = 0;
+ QmlListReference ref(&tt, "data");
+ QVERIFY(ref.canCount() == false);
+ }
+}
+
+void tst_QmlList::append()
+{
+ TestType *tt = new TestType;
+ QObject object;
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.append(tt) == false);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.append(tt) == false);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.append(tt) == true);
+ QVERIFY(tt->data.count() == 1);
+ QVERIFY(tt->data.at(0) == tt);
+ QVERIFY(ref.append(&object) == false);
+ QVERIFY(tt->data.count() == 1);
+ QVERIFY(tt->data.at(0) == tt);
+ QVERIFY(ref.append(0) == true);
+ QVERIFY(tt->data.count() == 2);
+ QVERIFY(tt->data.at(0) == tt);
+ QVERIFY(tt->data.at(1) == 0);
+ delete tt;
+ QVERIFY(ref.append(0) == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.append = 0;
+ QmlListReference ref(&tt, "data");
+ QVERIFY(ref.append(&tt) == false);
+ }
+}
+
+void tst_QmlList::at()
+{
+ TestType *tt = new TestType;
+ tt->data.append(tt);
+ tt->data.append(0);
+ tt->data.append(tt);
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.at(0) == 0);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.at(0) == 0);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.at(0) == tt);
+ QVERIFY(ref.at(1) == 0);
+ QVERIFY(ref.at(2) == tt);
+ delete tt;
+ QVERIFY(ref.at(0) == 0);
+ }
+
+ {
+ TestType tt;
+ tt.data.append(&tt);
+ tt.property.at = 0;
+ QmlListReference ref(&tt, "data");
+ QVERIFY(ref.at(0) == 0);
+ }
+}
+
+void tst_QmlList::clear()
+{
+ TestType *tt = new TestType;
+ tt->data.append(tt);
+ tt->data.append(0);
+ tt->data.append(tt);
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.clear() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.clear() == false);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.clear() == true);
+ QVERIFY(tt->data.count() == 0);
+ delete tt;
+ QVERIFY(ref.clear() == false);
+ }
+
+ {
+ TestType tt;
+ tt.property.clear = 0;
+ QmlListReference ref(&tt, "data");
+ QVERIFY(ref.clear() == false);
+ }
+}
+
+void tst_QmlList::count()
+{
+ TestType *tt = new TestType;
+ tt->data.append(tt);
+ tt->data.append(0);
+ tt->data.append(tt);
+
+ {
+ QmlListReference ref;
+ QVERIFY(ref.count() == 0);
+ }
+
+ {
+ QmlListReference ref(tt, "blah");
+ QVERIFY(ref.count() == 0);
+ }
+
+ {
+ QmlListReference ref(tt, "data");
+ QVERIFY(ref.count() == 3);
+ tt->data.removeAt(1);
+ QVERIFY(ref.count() == 2);
+ delete tt;
+ QVERIFY(ref.count() == 0);
+ }
+
+ {
+ TestType tt;
+ tt.data.append(&tt);
+ tt.property.count = 0;
+ QmlListReference ref(&tt, "data");
+ QVERIFY(ref.count() == 0);
+ }
+}
+
+void tst_QmlList::copy()
+{
+ TestType tt;
+ tt.data.append(&tt);
+ tt.data.append(0);
+ tt.data.append(&tt);
+
+ QmlListReference *r1 = new QmlListReference(&tt, "data");
+ QVERIFY(r1->count() == 3);
+
+ QmlListReference r2(*r1);
+ QmlListReference r3;
+ r3 = *r1;
+
+ QVERIFY(r2.count() == 3);
+ QVERIFY(r3.count() == 3);
+
+ delete r1;
+
+ QVERIFY(r2.count() == 3);
+ QVERIFY(r3.count() == 3);
+
+ tt.data.removeAt(2);
+
+ QVERIFY(r2.count() == 2);
+ QVERIFY(r3.count() == 2);
+}
+
+void tst_QmlList::qmlmetaproperty()
+{
+ TestType tt;
+ tt.data.append(&tt);
+ tt.data.append(0);
+ tt.data.append(&tt);
+
+ QmlMetaProperty prop(&tt, QLatin1String("data"));
+ QVariant v = prop.read();
+ QVERIFY(v.userType() == qMetaTypeId<QmlListReference>());
+ QmlListReference ref = qvariant_cast<QmlListReference>(v);
+ QVERIFY(ref.count() == 3);
+ QVERIFY(ref.listElementType() == &TestType::staticMetaObject);
+}
+
+void tst_QmlList::engineTypes()
+{
+ QmlEngine engine;
+ QmlComponent component(&engine, TEST_FILE("engineTypes.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o);
+
+ QmlMetaProperty p1(o, QLatin1String("myList"));
+ QVERIFY(p1.propertyCategory() == QmlMetaProperty::Normal);
+
+ QmlMetaProperty p2(o, QLatin1String("myList"), engine.rootContext());
+ QVERIFY(p2.propertyCategory() == QmlMetaProperty::List);
+ QVariant v = p2.read();
+ QVERIFY(v.userType() == qMetaTypeId<QmlListReference>());
+ QmlListReference ref = qvariant_cast<QmlListReference>(v);
+ QVERIFY(ref.count() == 2);
+ QVERIFY(ref.listElementType());
+ QVERIFY(ref.listElementType() != &QObject::staticMetaObject);
+
+ delete o;
+}
+
+void tst_QmlList::variantToList()
{
- QmlConcreteList<QObject*> list;
- QObject *obj = new QObject;
- obj->setObjectName("foo");
- list.append(obj);
- QVERIFY(list.count() == 1);
- QCOMPARE(list.at(0), obj);
+ QmlEngine engine;
+ QmlComponent component(&engine, TEST_FILE("variantToList.qml"));
- QmlPrivate::ListInterface *li = (QmlPrivate::ListInterface*)&list;
+ QObject *o = component.create();
+ QVERIFY(o);
- void *ptr[1];
- li->at(0, ptr);
- QVERIFY(li->count() == 1);
- QCOMPARE(ptr[0], obj);
+ QVERIFY(o->property("value").userType() == qMetaTypeId<QmlListReference>());
+ QCOMPARE(o->property("test").toInt(), 1);
- li->removeAt(0);
- QVERIFY(li->count() == 0);
- QVERIFY(list.count() == 0);
+ delete o;
}
QTEST_MAIN(tst_QmlList)
diff --git a/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro b/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro
deleted file mode 100644
index ce2915e..0000000
--- a/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_qmllistaccessor.cpp
diff --git a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp b/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp
deleted file mode 100644
index 3efe847..0000000
--- a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp
+++ /dev/null
@@ -1,452 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <qtest.h>
-#include <QtDeclarative/qml.h>
-#include <private/qmllistaccessor_p.h>
-#include <QDebug>
-
-class tst_QmlListAccessor : public QObject
-{
- Q_OBJECT
-public:
- tst_QmlListAccessor() {}
-
-private slots:
- void invalid();
- void qmllist();
- void qlist();
- void qstringlist();
- void qvariantlist();
- void qobject();
- void instance();
- void integer();
-};
-
-void tst_QmlListAccessor::invalid()
-{
- QmlListAccessor accessor;
-
- QCOMPARE(accessor.list(), QVariant());
- QVERIFY(!accessor.isValid());
- QCOMPARE(accessor.type(), QmlListAccessor::Invalid);
-
- QCOMPARE(accessor.count(), 0);
- QVERIFY(!accessor.append(QVariant(10)));
- QVERIFY(!accessor.insert(0, QVariant(10)));
- QVERIFY(!accessor.removeAt(0));
- QVERIFY(!accessor.clear());
-
- accessor.setList(QVariant());
-
- QCOMPARE(accessor.list(), QVariant());
- QVERIFY(!accessor.isValid());
- QCOMPARE(accessor.type(), QmlListAccessor::Invalid);
-
- QCOMPARE(accessor.count(), 0);
- QVERIFY(!accessor.append(QVariant(10)));
- QVERIFY(!accessor.insert(0, QVariant(10)));
- QVERIFY(!accessor.removeAt(0));
- QVERIFY(!accessor.clear());
-}
-
-void tst_QmlListAccessor::qmllist()
-{
- QmlConcreteList<QObject*> list;
- QObject *obj = new QObject(this);
- QObject *obj2 = new QObject(this);
- QObject *obj3 = new QObject(this);
-
- list.append(obj);
- QVERIFY(list.count() == 1);
- QCOMPARE(list.at(0), obj);
-
- QmlListAccessor accessor;
- accessor.setList(qVariantFromValue((QmlList<QObject*>*)&list));
- QCOMPARE(accessor.list(), qVariantFromValue((QmlList<QObject*>*)&list));
-
- // type
- QCOMPARE(accessor.type(), QmlListAccessor::QmlList);
-
- // isValid
- QVERIFY(accessor.isValid());
-
- // count
- QCOMPARE(accessor.count(), 1);
-
- // at
- QCOMPARE(qvariant_cast<QObject*>(accessor.at(0)), obj);
-
- // append
- accessor.append(qVariantFromValue(obj2));
- QVERIFY(accessor.isValid());
- QCOMPARE(accessor.count(), 2);
- QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj2);
- QCOMPARE(list.count(), 2);
- QCOMPARE(list.at(0), obj);
- QCOMPARE(list.at(1), obj2);
-
- // insert
- accessor.insert(1, qVariantFromValue(obj3));
- QVERIFY(accessor.isValid());
- QCOMPARE(accessor.count(), 3);
- QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj3);
- QCOMPARE(list.count(), 3);
- QCOMPARE(list.at(0), obj);
- QCOMPARE(list.at(1), obj3);
- QCOMPARE(list.at(2), obj2);
-
- // removeAt
- accessor.removeAt(1);
- QVERIFY(accessor.isValid());
- QCOMPARE(accessor.count(), 2);
- QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj2);
- QCOMPARE(list.count(), 2);
- QCOMPARE(list.at(0), obj);
- QCOMPARE(list.at(1), obj2);
-
- // clear
- accessor.clear();
- QVERIFY(accessor.isValid());
- QCOMPARE(accessor.count(), 0);
- QCOMPARE(list.count(), 0);
-}
-
-void tst_QmlListAccessor::qlist()
-{
- QList<QObject*> list;
- QObject *obj = new QObject(this);
- QObject *obj2 = new QObject(this);
- QObject *obj3 = new QObject(this);
-
- list.append(obj);
- QVERIFY(list.count() == 1);
- QCOMPARE(list.at(0), obj);
-
- QmlListAccessor accessor;
- accessor.setList(qVariantFromValue((QList<QObject*>*)&list));
- QCOMPARE(accessor.list(), qVariantFromValue((QList<QObject*>*)&list));
-
- // type
- QCOMPARE(accessor.type(), QmlListAccessor::QListPtr);
-
- // isValid
- QVERIFY(accessor.isValid());
-
- // count
- QCOMPARE(accessor.count(), 1);
-
- // at
- QCOMPARE(qvariant_cast<QObject*>(accessor.at(0)), obj);
-
- // append
- accessor.append(qVariantFromValue(obj2));
- QVERIFY(accessor.isValid());
- QCOMPARE(accessor.count(), 2);
- QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj2);
- QCOMPARE(list.count(), 2);
- QCOMPARE(list.at(0), obj);
- QCOMPARE(list.at(1), obj2);
-
- // insert
- accessor.insert(1, qVariantFromValue(obj3));
- QVERIFY(accessor.isValid());
- QCOMPARE(accessor.count(), 3);
- QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj3);
- QCOMPARE(list.count(), 3);
- QCOMPARE(list.at(0), obj);
- QCOMPARE(list.at(1), obj3);
- QCOMPARE(list.at(2), obj2);
-
- // removeAt
- accessor.removeAt(1);
- QVERIFY(accessor.isValid());
- QCOMPARE(accessor.count(), 2);
- QCOMPARE(qvariant_cast<QObject*>(accessor.at(1)), obj2);
- QCOMPARE(list.count(), 2);
- QCOMPARE(list.at(0), obj);
- QCOMPARE(list.at(1), obj2);
-
- // clear
- accessor.clear();
- QVERIFY(accessor.isValid());
- QCOMPARE(accessor.count(), 0);
- QCOMPARE(list.count(), 0);
-}
-
-void tst_QmlListAccessor::qstringlist()
-{
- QStringList list;
- list.append(QLatin1String("Item1"));
- list.append(QLatin1String("Item2"));
- QVERIFY(list.count() == 2);
-
- QmlListAccessor accessor;
- accessor.setList(list);
-
- // type
- QCOMPARE(accessor.type(), QmlListAccessor::StringList);
-
- // isValid
- QVERIFY(accessor.isValid());
-
- // count
- QVERIFY(accessor.count() == 2);
-
- // at
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-
- // append
- QVERIFY(!accessor.append(QVariant("Item3")));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 2);
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-
- // insert
- QVERIFY(!accessor.insert(1, QVariant("MiddleItem")));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 2);
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-
- // removeAt
- QVERIFY(!accessor.removeAt(1));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 2);
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-
- // clear
- QVERIFY(!accessor.clear());
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 2);
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-}
-
-void tst_QmlListAccessor::qvariantlist()
-{
- QVariantList list;
- list.append(QLatin1String("Item1"));
- list.append(QLatin1String("Item2"));
- QVERIFY(list.count() == 2);
-
- QmlListAccessor accessor;
- accessor.setList(list);
-
- // type
- QCOMPARE(accessor.type(), QmlListAccessor::VariantList);
-
- // isValid
- QVERIFY(accessor.isValid());
-
- // count
- QVERIFY(accessor.count() == 2);
-
- // at
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-
- // append
- QVERIFY(!accessor.append(QVariant("Item3")));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 2);
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-
- // insert
- QVERIFY(!accessor.insert(1, QVariant("MiddleItem")));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 2);
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-
- // removeAt
- QVERIFY(!accessor.removeAt(1));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 2);
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-
- // clear
- QVERIFY(!accessor.clear());
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 2);
- QCOMPARE(qvariant_cast<QString>(accessor.at(0)), QLatin1String("Item1"));
- QCOMPARE(qvariant_cast<QString>(accessor.at(1)), QLatin1String("Item2"));
-}
-
-void tst_QmlListAccessor::qobject()
-{
- QObject *obj = new QObject(this);
-
- QmlListAccessor accessor;
- accessor.setList(qVariantFromValue(obj));
-
- // type
- QCOMPARE(accessor.type(), QmlListAccessor::Instance);
-
- // isValid
- QVERIFY(accessor.isValid());
-
- // count
- QVERIFY(accessor.count() == 1);
-
- // at
- QCOMPARE(accessor.at(0), qVariantFromValue(obj));
-
- // append
- QVERIFY(!accessor.append(qVariantFromValue((QObject *)0)));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 1);
- QCOMPARE(accessor.at(0), qVariantFromValue(obj));
-
- // insert
- QVERIFY(!accessor.insert(0, qVariantFromValue((QObject *)0)));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 1);
- QCOMPARE(accessor.at(0), qVariantFromValue(obj));
-
- // removeAt
- QVERIFY(!accessor.removeAt(0));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 1);
- QCOMPARE(accessor.at(0), qVariantFromValue(obj));
-
- // clear
- QVERIFY(!accessor.clear());
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 1);
- QCOMPARE(accessor.at(0), qVariantFromValue(obj));
-}
-
-void tst_QmlListAccessor::instance()
-{
- QRect r;
-
- QmlListAccessor accessor;
- accessor.setList(r);
-
- // type
- QCOMPARE(accessor.type(), QmlListAccessor::Instance);
-
- // isValid
- QVERIFY(accessor.isValid());
-
- // count
- QVERIFY(accessor.count() == 1);
-
- // at
- QCOMPARE(accessor.at(0), qVariantFromValue(r));
-
- // append
- QVERIFY(!accessor.append(qVariantFromValue(r)));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 1);
- QCOMPARE(accessor.at(0), qVariantFromValue(r));
-
- // insert
- QVERIFY(!accessor.insert(0, qVariantFromValue(r)));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 1);
- QCOMPARE(accessor.at(0), qVariantFromValue(r));
-
- // removeAt
- QVERIFY(!accessor.removeAt(0));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 1);
- QCOMPARE(accessor.at(0), qVariantFromValue(r));
-
- // clear
- QVERIFY(!accessor.clear());
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 1);
- QCOMPARE(accessor.at(0), qVariantFromValue(r));
-}
-
-void tst_QmlListAccessor::integer()
-{
- int r = 13;
-
- QmlListAccessor accessor;
- accessor.setList(r);
-
- // type
- QCOMPARE(accessor.type(), QmlListAccessor::Integer);
-
- // isValid
- QVERIFY(accessor.isValid());
-
- // count
- QVERIFY(accessor.count() == 13);
-
- // at
- QCOMPARE(accessor.at(4), qVariantFromValue(4));
-
- // append
- QVERIFY(!accessor.append(qVariantFromValue(r)));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 13);
- QCOMPARE(accessor.at(4), qVariantFromValue(4));
-
- // insert
- QVERIFY(!accessor.insert(0, qVariantFromValue(r)));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 13);
- QCOMPARE(accessor.at(4), qVariantFromValue(4));
-
- // removeAt
- QVERIFY(!accessor.removeAt(0));
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 13);
- QCOMPARE(accessor.at(4), qVariantFromValue(4));
-
- // clear
- QVERIFY(!accessor.clear());
- QVERIFY(accessor.isValid());
- QVERIFY(accessor.count() == 13);
- QCOMPARE(accessor.at(4), qVariantFromValue(4));
-}
-
-QTEST_MAIN(tst_QmlListAccessor)
-
-#include "tst_qmllistaccessor.moc"
diff --git a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
index 91ff727..050cd3f 100644
--- a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
+++ b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
@@ -73,13 +73,11 @@ private:
class MyContainer : public QObject
{
Q_OBJECT
- Q_PROPERTY(QList<MyQmlObject*>* children READ children)
- Q_PROPERTY(QmlList<MyQmlObject*>* qmlChildren READ qmlChildren)
+ Q_PROPERTY(QmlListProperty<MyQmlObject> children READ children)
public:
MyContainer() {}
- QList<MyQmlObject*> *children() { return &m_children; }
- QmlConcreteList<MyQmlObject *> *qmlChildren() { return &m_qmlChildren; }
+ QmlListProperty<MyQmlObject> children() { return QmlListProperty<MyQmlObject>(this, m_children); }
static MyAttached *qmlAttachedProperties(QObject *o) {
return new MyAttached(o);
@@ -87,7 +85,6 @@ public:
private:
QList<MyQmlObject*> m_children;
- QmlConcreteList<MyQmlObject *> m_qmlChildren;
};
QML_DECLARE_TYPE(MyContainer);
@@ -118,7 +115,6 @@ private slots:
// Functionality
void writeObjectToList();
void writeListToList();
- void writeObjectToQmlList();
//writeToReadOnly();
@@ -1078,13 +1074,14 @@ void tst_qmlmetaproperty::writeObjectToList()
containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl());
MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
QVERIFY(container != 0);
- QVERIFY(container->children()->size() == 1);
+ QmlListReference list(container, "children");
+ QVERIFY(list.count() == 1);
MyQmlObject *object = new MyQmlObject;
QmlMetaProperty prop(container, "children");
prop.write(qVariantFromValue(object));
- QCOMPARE(container->children()->size(), 2);
- QCOMPARE(container->children()->at(1), object);
+ QCOMPARE(list.count(), 1);
+ QCOMPARE(list.at(0), object);
}
Q_DECLARE_METATYPE(QList<QObject *>);
@@ -1094,13 +1091,14 @@ void tst_qmlmetaproperty::writeListToList()
containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl());
MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
QVERIFY(container != 0);
- QVERIFY(container->children()->size() == 1);
+ QmlListReference list(container, "children");
+ QVERIFY(list.count() == 1);
QList<QObject*> objList;
objList << new MyQmlObject() << new MyQmlObject() << new MyQmlObject() << new MyQmlObject();
QmlMetaProperty prop(container, "children");
prop.write(qVariantFromValue(objList));
- QCOMPARE(container->children()->size(), 4);
+ QCOMPARE(list.count(), 4);
//XXX need to try this with read/write prop (for read-only it correctly doesn't write)
/*QList<MyQmlObject*> typedObjList;
@@ -1109,21 +1107,6 @@ void tst_qmlmetaproperty::writeListToList()
QCOMPARE(container->children()->size(), 1);*/
}
-void tst_qmlmetaproperty::writeObjectToQmlList()
-{
- QmlComponent containerComponent(&engine);
- containerComponent.setData("import Test 1.0\nMyContainer { qmlChildren: MyQmlObject {} }", QUrl());
- MyContainer *container = qobject_cast<MyContainer*>(containerComponent.create());
- QVERIFY(container != 0);
- QVERIFY(container->qmlChildren()->size() == 1);
-
- MyQmlObject *object = new MyQmlObject;
- QmlMetaProperty prop(container, "qmlChildren");
- prop.write(qVariantFromValue(object));
- QCOMPARE(container->qmlChildren()->size(), 2);
- QCOMPARE(container->qmlChildren()->at(1), object);
-}
-
void tst_qmlmetaproperty::crashOnValueProperty()
{
QmlEngine *engine = new QmlEngine;
diff --git a/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp b/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp
index 6d1887f..750ccf8 100644
--- a/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp
+++ b/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp
@@ -67,10 +67,6 @@ private slots:
void qmlPropertyValueInterceptorCast();
void isList();
- void isQmlList();
-
- void listCount();
- void listAt();
void defaultObject();
};
@@ -346,85 +342,12 @@ void tst_qmlmetatype::qmlPropertyValueInterceptorCast()
void tst_qmlmetatype::isList()
{
- QCOMPARE(QmlMetaType::isList(QVariant()), false);
QCOMPARE(QmlMetaType::isList(QVariant::Invalid), false);
QCOMPARE(QmlMetaType::isList(QVariant::Int), false);
- QCOMPARE(QmlMetaType::isList(QVariant(10)), false);
-
- QList<TestType *> list;
- QmlConcreteList<TestType *> qmllist;
-
- QCOMPARE(QmlMetaType::isList(qMetaTypeId<QList<TestType *>*>()), true);
- QCOMPARE(QmlMetaType::isList(QVariant::fromValue(&list)), true);
- QCOMPARE(QmlMetaType::isList(qMetaTypeId<QmlList<TestType *>*>()), false);
- QCOMPARE(QmlMetaType::isList(QVariant::fromValue((QmlList<TestType *>*)&qmllist)), false);
-}
-void tst_qmlmetatype::isQmlList()
-{
- QCOMPARE(QmlMetaType::isQmlList(QVariant::Invalid), false);
- QCOMPARE(QmlMetaType::isQmlList(QVariant::Int), false);
-
- QCOMPARE(QmlMetaType::isQmlList(qMetaTypeId<QList<TestType *>*>()), false);
- QCOMPARE(QmlMetaType::isQmlList(qMetaTypeId<QmlList<TestType *>*>()), true);
-}
+ QmlListProperty<TestType> list;
-void tst_qmlmetatype::listCount()
-{
- QCOMPARE(QmlMetaType::listCount(QVariant()), 0);
- QCOMPARE(QmlMetaType::listCount(QVariant(10)), 0);
-
- QList<TestType *> list;
- QVariant listVar = QVariant::fromValue(&list);
- QmlConcreteList<TestType *> qmllist;
- QVariant qmllistVar = QVariant::fromValue((QmlList<TestType *>*)&qmllist);
-
- QCOMPARE(QmlMetaType::listCount(listVar), 0);
- QCOMPARE(QmlMetaType::listCount(qmllistVar), 0);
-
- list.append(0); list.append(0); list.append(0);
- qmllist.append(0); qmllist.append(0); qmllist.append(0);
-
- QCOMPARE(QmlMetaType::listCount(listVar), 3);
- QCOMPARE(QmlMetaType::listCount(qmllistVar), 0);
-}
-
-void tst_qmlmetatype::listAt()
-{
- QCOMPARE(QmlMetaType::listAt(QVariant(), 0), QVariant());
- QCOMPARE(QmlMetaType::listAt(QVariant(10), 0), QVariant());
- QCOMPARE(QmlMetaType::listAt(QVariant(), 10), QVariant());
- QCOMPARE(QmlMetaType::listAt(QVariant(10), 10), QVariant());
- QCOMPARE(QmlMetaType::listAt(QVariant(), -10), QVariant());
- QCOMPARE(QmlMetaType::listAt(QVariant(10), -10), QVariant());
-
- QList<TestType *> list;
- QVariant listVar = QVariant::fromValue(&list);
- QmlConcreteList<TestType *> qmllist;
- QVariant qmllistVar = QVariant::fromValue((QmlList<TestType *>*)&qmllist);
-
- QCOMPARE(QmlMetaType::listAt(listVar, 0), QVariant());
- QCOMPARE(QmlMetaType::listAt(listVar, 2), QVariant());
- QCOMPARE(QmlMetaType::listAt(listVar, -1), QVariant());
-
- QCOMPARE(QmlMetaType::listAt(qmllistVar, 0), QVariant());
- QCOMPARE(QmlMetaType::listAt(qmllistVar, 2), QVariant());
- QCOMPARE(QmlMetaType::listAt(qmllistVar, -1), QVariant());
-
- TestType ttype;
- QVariant ttypeVar = QVariant::fromValue(&ttype);
- QVariant nullttypeVar = QVariant::fromValue((TestType *)0);
-
- list.append(0); list.append(&ttype); list.append(0);
- qmllist.append(0); qmllist.append(&ttype); qmllist.append(0);
-
- QCOMPARE(QmlMetaType::listAt(listVar, 0), nullttypeVar);
- QCOMPARE(QmlMetaType::listAt(listVar, 1), ttypeVar);
- QCOMPARE(QmlMetaType::listAt(listVar, -1), QVariant());
-
- QCOMPARE(QmlMetaType::listAt(qmllistVar, 0), QVariant());
- QCOMPARE(QmlMetaType::listAt(qmllistVar, 2), QVariant());
- QCOMPARE(QmlMetaType::listAt(qmllistVar, -1), QVariant());
+ QCOMPARE(QmlMetaType::isList(qMetaTypeId<QmlListProperty<TestType> >()), true);
}
void tst_qmlmetatype::defaultObject()
diff --git a/tests/auto/declarative/qmlstates/data/illegalTempState.qml b/tests/auto/declarative/qmlstates/data/illegalTempState.qml
index 2702be4..0dc39ae 100644
--- a/tests/auto/declarative/qmlstates/data/illegalTempState.qml
+++ b/tests/auto/declarative/qmlstates/data/illegalTempState.qml
@@ -14,7 +14,7 @@ Rectangle {
}
]
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: card.state = "placed"
}
diff --git a/tests/auto/declarative/qmlstates/data/legalTempState.qml b/tests/auto/declarative/qmlstates/data/legalTempState.qml
index 54c97b9..9be984c 100644
--- a/tests/auto/declarative/qmlstates/data/legalTempState.qml
+++ b/tests/auto/declarative/qmlstates/data/legalTempState.qml
@@ -16,7 +16,7 @@ Rectangle {
}
]
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: card.state = "placed"
}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange.qml b/tests/auto/declarative/qmlstates/data/parentChange.qml
index 087da6b..b8c7818 100644
--- a/tests/auto/declarative/qmlstates/data/parentChange.qml
+++ b/tests/auto/declarative/qmlstates/data/parentChange.qml
@@ -12,7 +12,7 @@ Rectangle {
color: "red"
}
}
- MouseRegion {
+ MouseArea {
id: clickable
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange2.qml b/tests/auto/declarative/qmlstates/data/parentChange2.qml
index f0b00f5..8b23591 100644
--- a/tests/auto/declarative/qmlstates/data/parentChange2.qml
+++ b/tests/auto/declarative/qmlstates/data/parentChange2.qml
@@ -15,7 +15,7 @@ Rectangle {
color: "red"
}
}
- MouseRegion {
+ MouseArea {
id: clickable
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange3.qml b/tests/auto/declarative/qmlstates/data/parentChange3.qml
index 2aa507c..ddf9268 100644
--- a/tests/auto/declarative/qmlstates/data/parentChange3.qml
+++ b/tests/auto/declarative/qmlstates/data/parentChange3.qml
@@ -16,7 +16,7 @@ Rectangle {
color: "red"
}
}
- MouseRegion {
+ MouseArea {
id: clickable
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange4.qml b/tests/auto/declarative/qmlstates/data/parentChange4.qml
index d00274b..34d667a 100644
--- a/tests/auto/declarative/qmlstates/data/parentChange4.qml
+++ b/tests/auto/declarative/qmlstates/data/parentChange4.qml
@@ -9,7 +9,7 @@ Rectangle {
width: 100; height: 100
color: "red"
}
- MouseRegion {
+ MouseArea {
id: clickable
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlstates/data/parentChange5.qml b/tests/auto/declarative/qmlstates/data/parentChange5.qml
index f75e2a3..56bdd89 100644
--- a/tests/auto/declarative/qmlstates/data/parentChange5.qml
+++ b/tests/auto/declarative/qmlstates/data/parentChange5.qml
@@ -9,7 +9,7 @@ Rectangle {
width: 100; height: 100
color: "red"
}
- MouseRegion {
+ MouseArea {
id: clickable
anchors.fill: parent
}
diff --git a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp
index 81145a8..b910c85 100644
--- a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp
+++ b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp
@@ -407,8 +407,12 @@ void tst_qmlstates::parentChange()
QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- qmlExecuteDeferred(rect->states()->at(0));
- QmlParentChange *pChange = qobject_cast<QmlParentChange*>(rect->states()->at(0)->changes()->at(0));
+ QmlListReference list(rect, "states");
+ QmlState *state = qobject_cast<QmlState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QmlParentChange *pChange = qobject_cast<QmlParentChange*>(state->operationAt(0));
QVERIFY(pChange != 0);
QmlGraphicsItem *nParent = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("NewParent"));
QVERIFY(nParent != 0);
@@ -510,8 +514,12 @@ void tst_qmlstates::anchorChanges()
QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- qmlExecuteDeferred(rect->states()->at(0));
- QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0));
+ QmlListReference list(rect, "states");
+ QmlState *state = qobject_cast<QmlState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
rect->setState("right");
@@ -565,8 +573,12 @@ void tst_qmlstates::anchorChanges3()
QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline"));
QVERIFY(bottomGuideline != 0);
- qmlExecuteDeferred(rect->states()->at(0));
- QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0));
+ QmlListReference list(rect, "states");
+ QmlState *state = qobject_cast<QmlState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
rect->setState("reanchored");
@@ -611,8 +623,12 @@ void tst_qmlstates::anchorChanges4()
QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline"));
QVERIFY(bottomGuideline != 0);
- qmlExecuteDeferred(rect->states()->at(0));
- QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0));
+ QmlListReference list(rect, "states");
+ QmlState *state = qobject_cast<QmlState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
rect->setState("reanchored");
@@ -642,8 +658,12 @@ void tst_qmlstates::anchorChanges5()
QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline"));
QVERIFY(bottomGuideline != 0);
- qmlExecuteDeferred(rect->states()->at(0));
- QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0));
+ QmlListReference list(rect, "states");
+ QmlState *state = qobject_cast<QmlState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
+ QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
rect->setState("reanchored");
@@ -700,7 +720,11 @@ void tst_qmlstates::explicitChanges()
QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- qmlExecuteDeferred(rect->states()->at(0));
+ QmlListReference list(rect, "states");
+ QmlState *state = qobject_cast<QmlState*>(list.at(0));
+ QVERIFY(state != 0);
+
+ qmlExecuteDeferred(state);
QmlPropertyChanges *changes = qobject_cast<QmlPropertyChanges*>(rect->findChild<QmlPropertyChanges*>("changes"));
QVERIFY(changes != 0);
QVERIFY(changes->isExplicit());
@@ -802,7 +826,7 @@ void tst_qmlstates::deletingChange()
QmlState *state = rect->findChild<QmlState*>();
QVERIFY(state != 0);
qmlExecuteDeferred(state);
- QCOMPARE(state->changes()->count(), 1);
+ QCOMPARE(state->operationCount(), 1);
rect->setState("blue");
QCOMPARE(rect->color(),QColor("red"));
diff --git a/tests/auto/declarative/visual/Package_Views/packageviews.qml b/tests/auto/declarative/visual/Package_Views/packageviews.qml
index dcfe7de..b577e45 100644
--- a/tests/auto/declarative/visual/Package_Views/packageviews.qml
+++ b/tests/auto/declarative/visual/Package_Views/packageviews.qml
@@ -29,14 +29,14 @@ Rectangle {
delegate: Package {
Rectangle {
id: listItem; Package.name: "list"; width:root.width/2; height: 50; color: "transparent"; border.color: "white"
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: myState.state = myState.state == "list" ? "grid" : "list"
}
}
Rectangle {
id: gridItem; Package.name: "grid"; width:50; height: 50; color: "transparent"; border.color: "white"
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: myState.state = myState.state == "list" ? "grid" : "list"
}
diff --git a/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml b/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml
index 5230ca4..70c14cf 100644
--- a/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml
+++ b/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml
@@ -20,7 +20,7 @@ Rectangle {
x: 50 + 50
}
PropertyChanges {
- target: myMouseRegion
+ target: myMouseArea
onClicked: page.state = ''
}
}
@@ -32,8 +32,8 @@ Rectangle {
}
}
]
- MouseRegion {
- id: myMouseRegion
+ MouseArea {
+ id: myMouseArea
anchors.fill: parent
onClicked: { page.state= 'hello' }
}
diff --git a/tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml b/tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml
index 0e98d7e..f205ae8 100644
--- a/tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml
+++ b/tests/auto/declarative/visual/animation/colorAnimation/colorAnimation.qml
@@ -34,7 +34,7 @@ Rectangle {
}
}
]
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: { mainrect.state = 'second' }
}
diff --git a/tests/auto/declarative/visual/animation/easing/easing.qml b/tests/auto/declarative/visual/animation/easing/easing.qml
index f81400b..9c814eb 100644
--- a/tests/auto/declarative/visual/animation/easing/easing.qml
+++ b/tests/auto/declarative/visual/animation/easing/easing.qml
@@ -186,7 +186,7 @@ Rectangle {
}
}
}
- MouseRegion {
+ MouseArea {
id: mouse
anchors.fill: layout
}
diff --git a/tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml b/tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml
index 7021e05..1980b91 100644
--- a/tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml
+++ b/tests/auto/declarative/visual/animation/parallelAnimation/parallelAnimation.qml
@@ -14,7 +14,7 @@ Rectangle {
color: "red"
}
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: parent.state = "state1"
}
diff --git a/tests/auto/declarative/visual/animation/parentAction/parentAction.qml b/tests/auto/declarative/visual/animation/parentAction/parentAction.qml
index e4f4406..eb3103e 100644
--- a/tests/auto/declarative/visual/animation/parentAction/parentAction.qml
+++ b/tests/auto/declarative/visual/animation/parentAction/parentAction.qml
@@ -15,7 +15,7 @@ Rectangle {
color: "red"
}
}
- MouseRegion {
+ MouseArea {
id: clickable
anchors.fill: parent
}
diff --git a/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml b/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml
index 68671e1..593f495 100644
--- a/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml
+++ b/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml
@@ -7,7 +7,7 @@ Rectangle {
width: 100; height: 100
color: "red"
}
- MouseRegion {
+ MouseArea {
id: clickable
anchors.fill: parent
}
diff --git a/tests/auto/declarative/visual/animation/reanchor/reanchor.qml b/tests/auto/declarative/visual/animation/reanchor/reanchor.qml
index 359346f..d80631f 100644
--- a/tests/auto/declarative/visual/animation/reanchor/reanchor.qml
+++ b/tests/auto/declarative/visual/animation/reanchor/reanchor.qml
@@ -19,7 +19,7 @@ Rectangle {
Item { id: topGuideline2; y: 50 }
Item { id: bottomGuideline2; y: 175 }
- MouseRegion {
+ MouseArea {
id: wholeArea
anchors.fill: parent
onClicked: {
@@ -55,7 +55,7 @@ Rectangle {
NumberAnimation { properties: "x,y,width,height" }
}
- MouseRegion {
+ MouseArea {
width: 50; height: 50
anchors.right: parent.right
anchors.bottom: parent.bottom
diff --git a/tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml b/tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml
index f121906..30d587a 100644
--- a/tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml
+++ b/tests/auto/declarative/visual/animation/scriptAction/scriptAction.qml
@@ -7,7 +7,7 @@ Rectangle {
width: 100; height: 100
color: "red"
}
- MouseRegion {
+ MouseArea {
id: clickable
anchors.fill: parent
}
diff --git a/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml b/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml
index cc15755..6204aa9 100644
--- a/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml
+++ b/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml
@@ -25,7 +25,7 @@ Rectangle {
Repeater {
model: list
Rectangle { width: 300; height: 200; color: mr.pressed ? "black" : dayColor
- MouseRegion {
+ MouseArea {
id: mr
anchors.fill: parent
}
@@ -49,7 +49,7 @@ Rectangle {
height: 48
y: parent.height - 50
color: "red"
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: flick.interactive = flick.interactive ? false : true
}
@@ -62,7 +62,7 @@ Rectangle {
x: 66
y: parent.height - 50
color: "green"
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: flick.pressDelay = flick.pressDelay > 0 ? 0 : 500
}
@@ -75,7 +75,7 @@ Rectangle {
x: 130
y: parent.height - 50
color: "yellow"
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: flick.overShoot = flick.overShoot > 0 ? 0 : 30
}
diff --git a/tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml b/tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml
index 70018b6..0adfa02 100644
--- a/tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml
+++ b/tests/auto/declarative/visual/qmlgraphicspathview/test-pathview.qml
@@ -22,7 +22,7 @@ Rectangle {
width: 85; height: 85; color: lColor
scale: wrapper.PathView.scale
- MouseRegion { anchors.fill: parent }
+ MouseArea { anchors.fill: parent }
transform: Rotation {
id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
diff --git a/tests/auto/declarative/visual/qmlmouseregion/drag.qml b/tests/auto/declarative/visual/qmlmouseregion/drag.qml
index ab4c280..dbb2a24 100644
--- a/tests/auto/declarative/visual/qmlmouseregion/drag.qml
+++ b/tests/auto/declarative/visual/qmlmouseregion/drag.qml
@@ -8,7 +8,7 @@ Rectangle{
id: draggable
width:40; height:40; color: "lightsteelblue"
y:20
- MouseRegion{
+ MouseArea{
anchors.fill: parent
drag.target: draggable
drag.axis: "XandYAxis"
diff --git a/tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml b/tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml
index ab4223d..3c722d0 100644
--- a/tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml
+++ b/tests/auto/declarative/visual/qmlmouseregion/mouseregion.qml
@@ -9,7 +9,7 @@ Rectangle {
Rectangle {
width: 98; height: 48
color: "red"
- MouseRegion {
+ MouseArea {
id: mr1
anchors.fill: parent
enabled: false
@@ -22,7 +22,7 @@ Rectangle {
x: 100
width: 98; height: 48
color: "red"
- MouseRegion {
+ MouseArea {
id: mr2
anchors.fill: parent
acceptedButtons: Qt.RightButton
@@ -42,7 +42,7 @@ Rectangle {
x: 200
width: 98; height: 48
color: "red"
- MouseRegion {
+ MouseArea {
id: mr3
anchors.fill: parent
onPressAndHold: {
@@ -56,7 +56,7 @@ Rectangle {
x: 300
width: 98; height: 48
color: "red"
- MouseRegion {
+ MouseArea {
id: mr4
anchors.fill: parent
onPressed: {
@@ -74,7 +74,7 @@ Rectangle {
y: 50
width: 98; height: 48
color: "red"
- MouseRegion {
+ MouseArea {
id: mr5
anchors.fill: parent
hoverEnabled: true
@@ -93,7 +93,7 @@ Rectangle {
y: 50
width: 98; height: 48
color: "red"
- MouseRegion {
+ MouseArea {
id: mr6
anchors.fill: parent
onClicked: {
@@ -111,7 +111,7 @@ Rectangle {
y: 50
width: 98; height: 48
color: "red"
- MouseRegion {
+ MouseArea {
id: mr7
anchors.fill: parent
enabled: false
diff --git a/tests/auto/declarative/visual/qmlspringfollow/follow.qml b/tests/auto/declarative/visual/qmlspringfollow/follow.qml
index 8a713a2..a85a778 100644
--- a/tests/auto/declarative/visual/qmlspringfollow/follow.qml
+++ b/tests/auto/declarative/visual/qmlspringfollow/follow.qml
@@ -44,7 +44,7 @@ Rectangle {
}
// Follow mouse
- MouseRegion {
+ MouseArea {
id: mouseRegion
anchors.fill: parent
Rectangle {
diff --git a/tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml b/tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml
index 21a19bc..da7f9b6 100644
--- a/tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml
+++ b/tests/auto/declarative/visual/selftest_noimages/selftest_noimages.qml
@@ -2,7 +2,7 @@ import Qt 4.6
Text {
property string error: "not pressed"
text: (new Date()).valueOf()
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onPressed: error=""
}
diff --git a/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml b/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml
index 2478932..72e672d 100644
--- a/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml
+++ b/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml
@@ -11,7 +11,7 @@ Grid {
anchors.fill: parent
settings.autoLoadImages: false
url: "test-img.html"
- MouseRegion {
+ MouseArea {
anchors.fill: parent
onClicked: { parent.settings.autoLoadImages=true; label.text=""; parent.reload.trigger() }
}
diff --git a/tests/benchmarks/declarative/painting/paintbenchmark.cpp b/tests/benchmarks/declarative/painting/paintbenchmark.cpp
index 9231b67..073e14e 100644
--- a/tests/benchmarks/declarative/painting/paintbenchmark.cpp
+++ b/tests/benchmarks/declarative/painting/paintbenchmark.cpp
@@ -43,6 +43,7 @@
#include <QPixmap>
#include <QImage>
#include <QPainter>
+#include <QPainterPath>
#include <QGLWidget>
#include <QTextLayout>
#include <QVBoxLayout>
@@ -218,6 +219,28 @@ void paint_QPixmapCachedRoundedRect(QPainter &p)
}
}
+void paint_pathCacheRoundedRect(QPainter &p)
+{
+ static bool first = true;
+ static QPainterPath path[lines];
+ if (first) {
+ for (int j = 0; j < lines; ++j) {
+ path[j].addRoundedRect(QRectF(0,0,(j+1)*50, spacing-1), 8, 8);
+ }
+ first = false;
+ }
+ p.setRenderHint(QPainter::Antialiasing, true);
+ p.setPen(Qt::black);
+ p.setBrush(Qt::red);
+ for (int i = 0; i < count; i++) {
+ for (int j = 0; j < lines; ++j) {
+ p.translate(0,j*spacing);
+ p.drawPath(path[j]);
+ p.translate(0,-j*spacing);
+ }
+ }
+}
+
void paint_QPixmap63x63_opaque(QPainter &p)
{
static bool first = true;
@@ -290,6 +313,7 @@ struct {
{ "CachedText", &paint_QPixmapCachedText },
{ "RoundedRect", &paint_RoundedRect },
{ "CachedRoundedRect", &paint_QPixmapCachedRoundedRect },
+ { "PathCacheRoundedRect", &paint_pathCacheRoundedRect },
{ "QPixmap63x63_opaque", &paint_QPixmap63x63_opaque },
{ "QPixmap64x64_opaque", &paint_QPixmap64x64_opaque },
{ "QPixmap63x63", &paint_QPixmap63x63 },
diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml
index 210c515..996602c 100644
--- a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml
+++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml
@@ -24,7 +24,7 @@ Item {
Text { },
Text { },
Text { },
- MouseRegion { }
+ MouseArea { }
]
}
diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml
index 943634f..9f79c34 100644
--- a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml
+++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml
@@ -24,7 +24,7 @@ Item {
Text { },
Text { },
Text { },
- MouseRegion { }
+ MouseArea { }
]
}
diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml
index ce986b5..335aeb8 100644
--- a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml
+++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml
@@ -24,7 +24,7 @@ Item {
Text { },
Text { },
Text { },
- MouseRegion { }
+ MouseArea { }
]
}
diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml
index 25e9c62..97bad47 100644
--- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml
+++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml
@@ -30,7 +30,7 @@ Item {
Text { }
}
}
- MouseRegion { }
+ MouseArea { }
}
}
}
diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml
index ee3f9d1..36dda15 100644
--- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml
+++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml
@@ -27,7 +27,7 @@ Item {
Text { }
Text { }
}
- MouseRegion { }
+ MouseArea { }
}
}
}
diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml
index 4c46ec1..396e27d 100644
--- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml
+++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml
@@ -30,7 +30,7 @@ Item {
Text { }
}
}
- MouseRegion { }
+ MouseArea { }
}
}
}