summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-11-06 04:26:00 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-11-06 04:26:00 (GMT)
commit47c8883e4341ee634fac0bee1aee56d8c6569e30 (patch)
treead31e7754da0f81f27e79056a92603378c0df9c0
parent28b9a4c1bfb6632a10f19bd51528f30205207da0 (diff)
parentd13d9d070e63cb9321bbdbc0eacf965f1ed070bb (diff)
downloadQt-47c8883e4341ee634fac0bee1aee56d8c6569e30.zip
Qt-47c8883e4341ee634fac0bee1aee56d8c6569e30.tar.gz
Qt-47c8883e4341ee634fac0bee1aee56d8c6569e30.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--demos/declarative/calculator/calculator.qml4
-rw-r--r--demos/declarative/flickr/common/ImageDetails.qml2
-rw-r--r--demos/declarative/flickr/common/MediaLineEdit.qml2
-rw-r--r--demos/declarative/flickr/common/ScrollBar.qml2
-rw-r--r--demos/declarative/flickr/common/Star.qml2
-rw-r--r--demos/declarative/flickr/flickr-desktop.qml8
-rw-r--r--demos/declarative/flickr/flickr-mobile.qml4
-rw-r--r--demos/declarative/flickr/mobile/GridDelegate.qml6
-rw-r--r--demos/declarative/flickr/mobile/ImageDetails.qml2
-rw-r--r--demos/declarative/flickr/mobile/TitleBar.qml2
-rw-r--r--demos/declarative/minehunt/minehunt.qml2
-rw-r--r--demos/declarative/twitter/content/HomeTitleBar.qml2
-rw-r--r--demos/declarative/twitter/content/MultiTitleBar.qml2
-rw-r--r--demos/declarative/twitter/content/TitleBar.qml2
-rw-r--r--demos/declarative/twitter/twitter.qml2
-rw-r--r--demos/declarative/webbrowser/fieldtext/FieldText.qml2
-rw-r--r--demos/declarative/webbrowser/webbrowser.qml8
-rw-r--r--doc/src/declarative/animation.qdoc12
-rw-r--r--doc/src/declarative/focus.qdoc2
-rw-r--r--doc/src/snippets/declarative/listview/highlight.qml2
-rw-r--r--examples/declarative/anchors/anchor-changes.qml2
-rw-r--r--examples/declarative/animations/easing.qml4
-rw-r--r--examples/declarative/behaviours/test.qml8
-rw-r--r--examples/declarative/layouts/Button.qml2
-rw-r--r--examples/declarative/layouts/positioners.qml26
-rw-r--r--examples/declarative/listview/dynamic.qml2
-rw-r--r--examples/declarative/listview/highlight.qml2
-rw-r--r--examples/declarative/listview/recipes.qml2
-rw-r--r--examples/declarative/loader/Browser.qml10
-rw-r--r--examples/declarative/parallax/qml/ParallaxView.qml2
-rw-r--r--examples/declarative/scrollbar/ScrollBar.qml2
-rw-r--r--examples/declarative/scrollbar/display.qml2
-rw-r--r--examples/declarative/searchbox/SearchBox.qml4
-rw-r--r--examples/declarative/slideswitch/Switch.qml2
-rw-r--r--examples/declarative/snow/ImageBatch.qml12
-rw-r--r--examples/declarative/states/transitions.qml8
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial3.qml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml2
-rw-r--r--examples/declarative/velocity/Day.qml2
-rw-r--r--examples/declarative/webview/autosize.qml2
-rw-r--r--examples/declarative/webview/content/FieldText.qml2
-rw-r--r--examples/declarative/xmldata/yahoonews.qml4
-rw-r--r--src/corelib/animation/qabstractanimation.cpp39
-rw-r--r--src/declarative/QmlChanges.txt2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem.cpp74
-rw-r--r--src/declarative/qml/qmlcompiler.cpp13
-rw-r--r--src/declarative/util/qmlanimation.cpp305
-rw-r--r--src/declarative/util/qmlanimation_p.h8
-rw-r--r--src/declarative/util/qmltimer.cpp5
-rw-r--r--tests/auto/declarative/anchors/data/anchors.qml27
-rw-r--r--tests/auto/declarative/anchors/tst_anchors.cpp16
-rw-r--r--tests/auto/declarative/animations/data/badproperty1.qml2
-rw-r--r--tests/auto/declarative/animations/data/badtype4.qml4
-rw-r--r--tests/auto/declarative/animations/data/dotproperty.qml4
-rw-r--r--tests/auto/declarative/animations/data/mixedtype1.qml2
-rw-r--r--tests/auto/declarative/animations/data/mixedtype2.qml2
-rw-r--r--tests/auto/declarative/animations/data/properties.qml14
-rw-r--r--tests/auto/declarative/animations/data/properties2.qml14
-rw-r--r--tests/auto/declarative/animations/data/properties3.qml14
-rw-r--r--tests/auto/declarative/animations/data/properties4.qml14
-rw-r--r--tests/auto/declarative/animations/data/properties5.qml14
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition2.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition3.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition4.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition5.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition6.qml29
-rw-r--r--tests/auto/declarative/animations/tst_animations.cpp144
-rw-r--r--tests/auto/declarative/behaviors/data/nonSelecting.qml2
-rw-r--r--tests/auto/declarative/behaviors/data/nonSelecting2.qml26
-rw-r--r--tests/auto/declarative/behaviors/tst_behaviors.cpp27
-rw-r--r--tests/auto/declarative/declarative.pro3
-rw-r--r--tests/auto/declarative/layouts/data/grid-animated.qml6
-rw-r--r--tests/auto/declarative/layouts/data/horizontal-animated.qml6
-rw-r--r--tests/auto/declarative/layouts/data/vertical-animated.qml6
-rw-r--r--tests/auto/declarative/qmlgraphicsitem/data/keys.qml15
-rw-r--r--tests/auto/declarative/qmlgraphicsitem/qmlgraphicsitem.pro7
-rw-r--r--tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp237
-rw-r--r--tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml (renamed from tests/auto/declarative/listview/data/listview-enforcerange.qml)0
-rw-r--r--tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml (renamed from tests/auto/declarative/listview/data/listview-sections.qml)0
-rw-r--r--tests/auto/declarative/qmlgraphicslistview/data/listview.qml (renamed from tests/auto/declarative/listview/data/listview.qml)0
-rw-r--r--tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro (renamed from tests/auto/declarative/listview/listview.pro)2
-rw-r--r--tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp (renamed from tests/auto/declarative/listview/tst_listview.cpp)2
-rw-r--r--tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml1
-rw-r--r--tests/auto/declarative/qmllanguage/data/attachedProperties.qml3
-rw-r--r--tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml7
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml7
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml8
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml7
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml7
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml7
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml7
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt1
-rw-r--r--tests/auto/declarative/qmllanguage/data/wrongType.15.qml4
-rw-r--r--tests/auto/declarative/qmllanguage/testtypes.h19
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp36
-rw-r--r--tests/auto/declarative/qmltimer/tst_qmltimer.cpp10
-rw-r--r--tests/auto/declarative/visual/bindinganimation/bindinganimation.qml2
-rw-r--r--tests/auto/declarative/visual/easing/easing.qml2
131 files changed, 1350 insertions, 267 deletions
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 54af7ad..d9b73ed 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -118,7 +118,7 @@ Rectangle {
}
transitions: Transition {
- NumberAnimation { properties: "x,y,width"; easing: "easeOutBounce"; duration: 500 }
- NumberAnimation { properties: "opacity"; easing: "easeInOutQuad"; duration: 500 }
+ NumberAnimation { matchProperties: "x,y,width"; easing: "easeOutBounce"; duration: 500 }
+ NumberAnimation { matchProperties: "opacity"; easing: "easeInOutQuad"; duration: 500 }
}
}
diff --git a/demos/declarative/flickr/common/ImageDetails.qml b/demos/declarative/flickr/common/ImageDetails.qml
index 19cad06..95c32e8 100644
--- a/demos/declarative/flickr/common/ImageDetails.qml
+++ b/demos/declarative/flickr/common/ImageDetails.qml
@@ -149,7 +149,7 @@ Flipable {
property: "smooth"
value: false
}
- NumberAnimation { easing: "easeInOutQuad"; properties: "angle"; duration: 500 }
+ NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 500 }
PropertyAction {
target: bigImage
property: "smooth"
diff --git a/demos/declarative/flickr/common/MediaLineEdit.qml b/demos/declarative/flickr/common/MediaLineEdit.qml
index b24b296..abc8034 100644
--- a/demos/declarative/flickr/common/MediaLineEdit.qml
+++ b/demos/declarative/flickr/common/MediaLineEdit.qml
@@ -42,7 +42,7 @@ Item {
]
transitions: [
Transition {
- NumberAnimation { properties: "x,width"; duration: 500; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "x,width"; duration: 500; easing: "easeInOutQuad" }
}
]
diff --git a/demos/declarative/flickr/common/ScrollBar.qml b/demos/declarative/flickr/common/ScrollBar.qml
index feebcb0..2c1ec8a 100644
--- a/demos/declarative/flickr/common/ScrollBar.qml
+++ b/demos/declarative/flickr/common/ScrollBar.qml
@@ -32,7 +32,7 @@ Item {
to: "*"
NumberAnimation {
target: container
- properties: "opacity"
+ matchProperties: "opacity"
duration: 400
}
}
diff --git a/demos/declarative/flickr/common/Star.qml b/demos/declarative/flickr/common/Star.qml
index 173021b..c5abcca 100644
--- a/demos/declarative/flickr/common/Star.qml
+++ b/demos/declarative/flickr/common/Star.qml
@@ -37,7 +37,7 @@ Item {
transitions: [
Transition {
NumberAnimation {
- properties: "opacity,scale,x,y"
+ matchProperties: "opacity,scale,x,y"
easing: "easeOutBounce"
}
}
diff --git a/demos/declarative/flickr/flickr-desktop.qml b/demos/declarative/flickr/flickr-desktop.qml
index 337f77c..9c85237 100644
--- a/demos/declarative/flickr/flickr-desktop.qml
+++ b/demos/declarative/flickr/flickr-desktop.qml
@@ -84,15 +84,15 @@ Item {
from: "*"; to: "Details"
SequentialAnimation {
ParentAction { }
- NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" }
}
},
Transition {
from: "Details"; to: "*"
SequentialAnimation {
ParentAction { }
- NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" }
- PropertyAction { target: wrapper; properties: "z" }
+ NumberAnimation { matchProperties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" }
+ PropertyAction { matchTargets: wrapper; matchProperties: "z" }
}
}
]
@@ -178,7 +178,7 @@ Item {
transitions: [
Transition {
from: "*"; to: "*"
- NumberAnimation { properties: "y"; duration: 1000; easing: "easeOutBounce(amplitude:0.5)" }
+ NumberAnimation { matchProperties: "y"; duration: 1000; easing: "easeOutBounce(amplitude:0.5)" }
}
]
}
diff --git a/demos/declarative/flickr/flickr-mobile.qml b/demos/declarative/flickr/flickr-mobile.qml
index 0a89c4f..583f992 100644
--- a/demos/declarative/flickr/flickr-mobile.qml
+++ b/demos/declarative/flickr/flickr-mobile.qml
@@ -38,7 +38,7 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; duration: 500; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "x"; duration: 500; easing: "easeInOutQuad" }
}
}
@@ -76,7 +76,7 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; duration: 500; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "x"; duration: 500; easing: "easeInOutQuad" }
}
}
}
diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml
index 9b9fb24..3a42507 100644
--- a/demos/declarative/flickr/mobile/GridDelegate.qml
+++ b/demos/declarative/flickr/mobile/GridDelegate.qml
@@ -55,14 +55,14 @@
Transition {
from: "Show"; to: "Details"
ParentAction { }
- NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" }
},
Transition {
from: "Details"; to: "Show"
SequentialAnimation {
ParentAction { }
- NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" }
- PropertyAction { target: wrapper; properties: "z" }
+ NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" }
+ PropertyAction { matchTargets: wrapper; matchProperties: "z" }
}
}
]
diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml
index 1963bf5..9116428 100644
--- a/demos/declarative/flickr/mobile/ImageDetails.qml
+++ b/demos/declarative/flickr/mobile/ImageDetails.qml
@@ -117,7 +117,7 @@ Flipable {
transitions: Transition {
SequentialAnimation {
PropertyAction { target: bigImage; property: "smooth"; value: false }
- NumberAnimation { easing: "easeInOutQuad"; properties: "angle"; duration: 500 }
+ NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 500 }
PropertyAction { target: bigImage; property: "smooth"; value: !flickable.moving }
}
}
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
index 07b9762..0341585 100644
--- a/demos/declarative/flickr/mobile/TitleBar.qml
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -71,6 +71,6 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad" }
}
}
diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml
index e71ce90..596e82d 100644
--- a/demos/declarative/minehunt/minehunt.qml
+++ b/demos/declarative/minehunt/minehunt.qml
@@ -93,7 +93,7 @@ Item {
}
NumberAnimation {
easing: "easeInOutQuad"
- properties: "angle"
+ matchProperties: "angle"
}
ScriptAction{
script: if(modelData.hasMine && modelData.flipped){expl.explode = true;}
diff --git a/demos/declarative/twitter/content/HomeTitleBar.qml b/demos/declarative/twitter/content/HomeTitleBar.qml
index f0d6d75..b4f24ea 100644
--- a/demos/declarative/twitter/content/HomeTitleBar.qml
+++ b/demos/declarative/twitter/content/HomeTitleBar.qml
@@ -114,7 +114,7 @@ Item {
transitions: [
Transition {
from: "*"; to: "*"
- NumberAnimation { properties: "x,y,width,height"; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "x,y,width,height"; easing: "easeInOutQuad" }
}
]
}
diff --git a/demos/declarative/twitter/content/MultiTitleBar.qml b/demos/declarative/twitter/content/MultiTitleBar.qml
index ef7de65..ef8a450 100644
--- a/demos/declarative/twitter/content/MultiTitleBar.qml
+++ b/demos/declarative/twitter/content/MultiTitleBar.qml
@@ -18,7 +18,7 @@ Item {
}
]
transitions: [
- Transition { NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } }
+ Transition { NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } }
]
}
diff --git a/demos/declarative/twitter/content/TitleBar.qml b/demos/declarative/twitter/content/TitleBar.qml
index 07b9762..0341585 100644
--- a/demos/declarative/twitter/content/TitleBar.qml
+++ b/demos/declarative/twitter/content/TitleBar.qml
@@ -71,6 +71,6 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad" }
}
}
diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml
index 6cc67a1..db1ae39 100644
--- a/demos/declarative/twitter/twitter.qml
+++ b/demos/declarative/twitter/twitter.qml
@@ -87,7 +87,7 @@ Item {
}
]
transitions: [
- Transition { NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } }
+ Transition { NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } }
]
}
}
diff --git a/demos/declarative/webbrowser/fieldtext/FieldText.qml b/demos/declarative/webbrowser/fieldtext/FieldText.qml
index b1c1938..6b1d271 100644
--- a/demos/declarative/webbrowser/fieldtext/FieldText.qml
+++ b/demos/declarative/webbrowser/fieldtext/FieldText.qml
@@ -149,7 +149,7 @@ Item {
to: "*"
reversible: true
NumberAnimation {
- properties: "opacity,leftMargin,rightMargin"
+ matchProperties: "opacity,leftMargin,rightMargin"
duration: 200
}
ColorAnimation {
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml
index cfc2aa7..6be3e09 100644
--- a/demos/declarative/webbrowser/webbrowser.qml
+++ b/demos/declarative/webbrowser/webbrowser.qml
@@ -149,8 +149,8 @@ Item {
transitions: [
Transition {
NumberAnimation {
- target: header
- properties: "progressOff"
+ matchTargets: header
+ matchProperties: "progressOff"
easing: "easeInOutQuad"
duration: 300
}
@@ -341,7 +341,7 @@ Item {
transitions: [
Transition {
NumberAnimation {
- properties: "opacity"
+ matchProperties: "opacity"
easing: "easeInOutQuad"
duration: 300
}
@@ -397,7 +397,7 @@ Item {
transitions: [
Transition {
NumberAnimation {
- properties: "opacity"
+ matchProperties: "opacity"
easing: "easeInOutQuad"
duration: 320
}
diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc
index ef18de3..ba45d81 100644
--- a/doc/src/declarative/animation.qdoc
+++ b/doc/src/declarative/animation.qdoc
@@ -113,7 +113,7 @@ For example, a transition could describe how an item moves from its initial posi
transitions: [
Transition {
NumberAnimation {
- properties: "x,y"
+ matchProperties: "x,y"
easing: "easeOutBounce"
duration: 200
}
@@ -123,7 +123,7 @@ transitions: [
As you can see from the above example, transitions make use of the same basic animation classes introduced
above. However, you generally use a different set of properties when working with transitions. In the example,
-no target or property has been specified. Instead, we have specified properties, which acts as a selector to
+no target or property has been specified. Instead, we have specified matchProperties, which acts as a selector to
determine which property changes to animate; in this case, we will animate any x,y properties that have
changed on any objects.
@@ -156,13 +156,13 @@ Transition {
NumberAnimation {
duration: 1000
easing: "easeOutBounce"
- target: box1
- properties: "x,y"
+ matchTargets: box1
+ matchProperties: "x,y"
}
NumberAnimation {
duration: 1000
- target: box2
- properties: "x,y"
+ matchTargets: box2
+ matchProperties: "x,y"
}
}
}
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
index ec6a02f..6eca667 100644
--- a/doc/src/declarative/focus.qdoc
+++ b/doc/src/declarative/focus.qdoc
@@ -75,6 +75,8 @@ Item {
\endlist
+See also the \l {Keys}{Keys attached property} and {KeyNavigation}{KeyNavigation attached property}.
+
\section1 Querying the Active Focus Item
Whether or not an \l Item has \e {active focus} can be queried through the
diff --git a/doc/src/snippets/declarative/listview/highlight.qml b/doc/src/snippets/declarative/listview/highlight.qml
index 7970ede..b016f9a 100644
--- a/doc/src/snippets/declarative/listview/highlight.qml
+++ b/doc/src/snippets/declarative/listview/highlight.qml
@@ -30,7 +30,7 @@ Rectangle {
}
]
transitions: [
- Transition { NumberAnimation { properties: "x"; duration: 200 } }
+ Transition { NumberAnimation { matchProperties: "x"; duration: 200 } }
]
}
}
diff --git a/examples/declarative/anchors/anchor-changes.qml b/examples/declarative/anchors/anchor-changes.qml
index f6fd35d..2ebe1c0 100644
--- a/examples/declarative/anchors/anchor-changes.qml
+++ b/examples/declarative/anchors/anchor-changes.qml
@@ -41,6 +41,6 @@ Item {
}
transitions : Transition {
- NumberAnimation { properties: "y,height" }
+ NumberAnimation { matchProperties: "y,height" }
}
}
diff --git a/examples/declarative/animations/easing.qml b/examples/declarative/animations/easing.qml
index 59e9b17..a9ba05f 100644
--- a/examples/declarative/animations/easing.qml
+++ b/examples/declarative/animations/easing.qml
@@ -80,8 +80,8 @@ Rectangle {
transitions: Transition {
ParallelAnimation {
- NumberAnimation { properties: "x"; easing: type; duration: 1000 }
- ColorAnimation { properties: "color"; easing: type; duration: 1000 }
+ NumberAnimation { matchProperties: "x"; easing: type; duration: 1000 }
+ ColorAnimation { matchProperties: "color"; easing: type; duration: 1000 }
}
}
}
diff --git a/examples/declarative/behaviours/test.qml b/examples/declarative/behaviours/test.qml
index 946559b..4a44fd7 100644
--- a/examples/declarative/behaviours/test.qml
+++ b/examples/declarative/behaviours/test.qml
@@ -61,7 +61,7 @@ Rectangle {
SequentialAnimation {
NumberAnimation {
target: bluerect
- properties: "y"
+ property: "y"
from: 0
to: 10
easing: "easeOutBounce(amplitude:30)"
@@ -69,7 +69,7 @@ Rectangle {
}
NumberAnimation {
target: bluerect
- properties: "y"
+ property: "y"
from: 10
to: 0
easing: "easeOutBounce(amplitude:30)"
@@ -83,14 +83,14 @@ Rectangle {
SequentialAnimation {
NumberAnimation {
target: bluerect
- properties: "opacity"
+ property: "opacity"
to: 0
duration: 150
}
PropertyAction {}
NumberAnimation {
target: bluerect
- properties: "opacity"
+ property: "opacity"
to: 1
duration: 150
}
diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml
index 44d0c7b..215b536 100644
--- a/examples/declarative/layouts/Button.qml
+++ b/examples/declarative/layouts/Button.qml
@@ -17,6 +17,6 @@ Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.wid
transitions:
Transition{
- NumberAnimation { properties:"x,left"; easing:"easeInOutQuad"; duration:200 }
+ NumberAnimation { matchProperties:"x,left"; easing:"easeInOutQuad"; duration:200 }
}
}
diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/layouts/positioners.qml
index 90efde2..129effe 100644
--- a/examples/declarative/layouts/positioners.qml
+++ b/examples/declarative/layouts/positioners.qml
@@ -11,17 +11,17 @@ Rectangle {
y: 0
move: Transition {
NumberAnimation {
- properties: "y"; easing: "easeOutBounce"
+ matchProperties: "y"; easing: "easeOutBounce"
}
}
add: Transition {
NumberAnimation {
- properties: "y"; from: 500; duration:500; easing: "easeOutQuad"
+ matchProperties: "y"; from: 500; duration:500; easing: "easeOutQuad"
}
}
remove: Transition {
NumberAnimation {
- properties:"y"; to: 500; duration:500; easing: "easeInQuad"
+ matchProperties:"y"; to: 500; duration:500; easing: "easeInQuad"
}
}
Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 }
@@ -36,23 +36,23 @@ Rectangle {
y: 300
move: Transition {
NumberAnimation {
- properties: "x"; easing: "easeOutBounce"
+ matchProperties: "x"; easing: "easeOutBounce"
}
}
add: Transition {
NumberAnimation {
- properties: "x"; from: 500; duration:500; easing: "easeOutQuad"
+ matchProperties: "x"; from: 500; duration:500; easing: "easeOutQuad"
}
NumberAnimation {
- properties: "opacity"; from: 0; duration: 500;
+ matchProperties: "opacity"; from: 0; duration: 500;
}
}
remove: Transition {
NumberAnimation {
- properties: "x"; to: 500; duration:500; easing: "easeInQuad"
+ matchProperties: "x"; to: 500; duration:500; easing: "easeInQuad"
}
NumberAnimation {
- properties: "opacity"; from: 1; duration: 500
+ matchProperties: "opacity"; from: 1; duration: 500
}
}
Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 }
@@ -103,25 +103,25 @@ Rectangle {
remove: Transition {
NumberAnimation {
- properties: "opacity"; from: 1; to: 0; duration: 500
+ matchProperties: "opacity"; from: 1; to: 0; duration: 500
}
NumberAnimation {
- properties: "x,y"; easing: "easeOutBounce"
+ matchProperties: "x,y"; easing: "easeOutBounce"
}
}
move: Transition {
NumberAnimation {
- properties: "x,y"; easing: "easeOutBounce"
+ matchProperties: "x,y"; easing: "easeOutBounce"
}
}
add: Transition {
NumberAnimation {
- properties: "opacity"; from: 0; to: 1; duration: 500
+ matchProperties: "opacity"; from: 0; to: 1; duration: 500
}
NumberAnimation {
- properties: "x,y"; easing: "easeOutBounce"
+ matchProperties: "x,y"; easing: "easeOutBounce"
}
}
diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml
index 2607527..101b708 100644
--- a/examples/declarative/listview/dynamic.qml
+++ b/examples/declarative/listview/dynamic.qml
@@ -122,7 +122,7 @@ Rectangle {
PropertyChanges { target: verticalScrollBar; opacity: 1 }
}
]
- transitions: [ Transition { NumberAnimation { properties: "opacity"; duration: 400 } } ]
+ transitions: [ Transition { NumberAnimation { matchProperties: "opacity"; duration: 400 } } ]
}
Row {
diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/listview/highlight.qml
index be1f62d..9665499 100644
--- a/examples/declarative/listview/highlight.qml
+++ b/examples/declarative/listview/highlight.qml
@@ -31,7 +31,7 @@ Rectangle {
transitions: [
Transition {
NumberAnimation {
- properties: "x"; duration: 200
+ matchProperties: "x"; duration: 200
}
}
]
diff --git a/examples/declarative/listview/recipes.qml b/examples/declarative/listview/recipes.qml
index 3410f56..c133351 100644
--- a/examples/declarative/listview/recipes.qml
+++ b/examples/declarative/listview/recipes.qml
@@ -124,7 +124,7 @@ Rectangle {
ParallelAnimation {
ColorAnimation { property: "color"; duration: 500 }
NumberAnimation {
- duration: 300; properties: "detailsOpacity,x,viewportY,height,width"
+ duration: 300; matchProperties: "detailsOpacity,x,viewportY,height,width"
}
}
}
diff --git a/examples/declarative/loader/Browser.qml b/examples/declarative/loader/Browser.qml
index 9139346..f3a1182 100644
--- a/examples/declarative/loader/Browser.qml
+++ b/examples/declarative/loader/Browser.qml
@@ -132,12 +132,12 @@ Rectangle {
Transition {
to: "current"
SequentialAnimation {
- NumberAnimation { properties: "x"; duration: 250 }
+ NumberAnimation { matchProperties: "x"; duration: 250 }
}
},
Transition {
- NumberAnimation { properties: "x"; duration: 250 }
- NumberAnimation { properties: "x"; duration: 250 }
+ NumberAnimation { matchProperties: "x"; duration: 250 }
+ NumberAnimation { matchProperties: "x"; duration: 250 }
}
]
}
@@ -171,11 +171,11 @@ Rectangle {
Transition {
to: "current"
SequentialAnimation {
- NumberAnimation { properties: "x"; duration: 250 }
+ NumberAnimation { matchProperties: "x"; duration: 250 }
}
},
Transition {
- NumberAnimation { properties: "x"; duration: 250 }
+ NumberAnimation { matchProperties: "x"; duration: 250 }
}
]
}
diff --git a/examples/declarative/parallax/qml/ParallaxView.qml b/examples/declarative/parallax/qml/ParallaxView.qml
index ac84b47..98dd246 100644
--- a/examples/declarative/parallax/qml/ParallaxView.qml
+++ b/examples/declarative/parallax/qml/ParallaxView.qml
@@ -80,7 +80,7 @@ Item {
}
transitions: Transition {
NumberAnimation {
- properties: "scale,y"
+ matchProperties: "scale,y"
}
}
}
diff --git a/examples/declarative/scrollbar/ScrollBar.qml b/examples/declarative/scrollbar/ScrollBar.qml
index 802b537..f68775c 100644
--- a/examples/declarative/scrollbar/ScrollBar.qml
+++ b/examples/declarative/scrollbar/ScrollBar.qml
@@ -2,7 +2,7 @@ import Qt 4.6
Item {
id: scrollBar
- // The properties that define the scrollbar's state.
+ // The matchProperties that define the scrollbar's state.
// position and pageSize are in the range 0.0 - 1.0. They are relative to the
// height of the page, i.e. a pageSize of 0.5 means that you can see 50%
// of the height of the view.
diff --git a/examples/declarative/scrollbar/display.qml b/examples/declarative/scrollbar/display.qml
index 536a8b7..0b9f95a 100644
--- a/examples/declarative/scrollbar/display.qml
+++ b/examples/declarative/scrollbar/display.qml
@@ -27,7 +27,7 @@ Rectangle {
from: "*"
to: "*"
NumberAnimation {
- properties: "opacity"
+ matchProperties: "opacity"
duration: 400
}
}
diff --git a/examples/declarative/searchbox/SearchBox.qml b/examples/declarative/searchbox/SearchBox.qml
index 7077a11..42b5d67 100644
--- a/examples/declarative/searchbox/SearchBox.qml
+++ b/examples/declarative/searchbox/SearchBox.qml
@@ -50,11 +50,11 @@ FocusScope {
transitions: [
Transition {
from: ""; to: "hasText"
- NumberAnimation { exclude: typeSomething; properties: "opacity" }
+ NumberAnimation { exclude: typeSomething; matchProperties: "opacity" }
},
Transition {
from: "hasText"; to: ""
- NumberAnimation { properties: "opacity" }
+ NumberAnimation { matchProperties: "opacity" }
}
]
}
diff --git a/examples/declarative/slideswitch/Switch.qml b/examples/declarative/slideswitch/Switch.qml
index 1620805..4e13976 100644
--- a/examples/declarative/slideswitch/Switch.qml
+++ b/examples/declarative/slideswitch/Switch.qml
@@ -52,7 +52,7 @@ Item {
]
transitions: [
Transition {
- NumberAnimation { properties: "x"; easing: "easeInOutQuad"; duration: 200 }
+ NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad"; duration: 200 }
}
]
}
diff --git a/examples/declarative/snow/ImageBatch.qml b/examples/declarative/snow/ImageBatch.qml
index 95b9b97..1d738b2 100644
--- a/examples/declarative/snow/ImageBatch.qml
+++ b/examples/declarative/snow/ImageBatch.qml
@@ -23,7 +23,7 @@ GridView {
transitions: Transition {
SequentialAnimation {
PauseAnimation { duration: 150 }
- PropertyAction { properties: "z" }
+ PropertyAction { matchProperties: "z" }
}
}
model: XmlListModel {
@@ -42,7 +42,7 @@ GridView {
width: grid.imageWidth; height: grid.imageHeight;
Image { id: flickrImage; source: url; fillMode: Image.PreserveAspectFit; smooth: true; anchors.fill: parent;
- opacity: (status == Image.Ready)?1:0; opacity: Behavior { NumberAnimation { properties: "opacity" } } }
+ opacity: (status == Image.Ready)?1:0; opacity: Behavior { NumberAnimation { } } }
Loading { anchors.centerIn: parent; visible: flickrImage.status!=1 }
states: State {
@@ -55,15 +55,15 @@ GridView {
to: "selected"
SequentialAnimation {
PauseAnimation { duration: 150 }
- PropertyAction { properties: "z" }
- NumberAnimation { properties: "scale"; duration: 150; }
+ PropertyAction { matchProperties: "z" }
+ NumberAnimation { matchProperties: "scale"; duration: 150; }
}
},
Transition {
from: "selected"
SequentialAnimation {
- NumberAnimation { properties: "scale"; duration: 150 }
- PropertyAction { properties: "z" }
+ NumberAnimation { matchProperties: "scale"; duration: 150 }
+ PropertyAction { matchProperties: "z" }
}
}
]
diff --git a/examples/declarative/states/transitions.qml b/examples/declarative/states/transitions.qml
index ba97d9be..925d90e 100644
--- a/examples/declarative/states/transitions.qml
+++ b/examples/declarative/states/transitions.qml
@@ -48,23 +48,23 @@ Rectangle {
}
]
- // transitions define how the properties change.
+ // transitions define how the matchProperties change.
transitions: [
// When transitioning to 'Position1' move x,y over a duration of 1 second,
// with easeOutBounce easing function.
Transition {
from: "*"; to: "Position1"
- NumberAnimation { properties: "x,y"; easing: "easeOutBounce"; duration: 1000 }
+ NumberAnimation { matchProperties: "x,y"; easing: "easeOutBounce"; duration: 1000 }
},
// When transitioning to 'Position2' move x,y over a duration of 2 seconds,
// with easeInOutQuad easing function.
Transition {
from: "*"; to: "Position2"
- NumberAnimation { properties: "x,y"; easing: "easeInOutQuad"; duration: 2000 }
+ NumberAnimation { matchProperties: "x,y"; easing: "easeInOutQuad"; duration: 2000 }
},
// For any other state changes move x,y linearly over duration of 200ms.
Transition {
- NumberAnimation { properties: "x,y"; duration: 200 }
+ NumberAnimation { matchProperties: "x,y"; duration: 200 }
}
]
}
diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml
index 534d663..52c3fe8 100644
--- a/examples/declarative/tutorials/helloworld/tutorial3.qml
+++ b/examples/declarative/tutorials/helloworld/tutorial3.qml
@@ -28,7 +28,7 @@ Rectangle {
transitions: Transition {
from: ""; to: "down"; reversible: true
ParallelAnimation {
- NumberAnimation { properties: "y,rotation"; duration: 500; easing: "easeInOutQuad" }
+ NumberAnimation { matchProperties: "y,rotation"; duration: 500; easing: "easeInOutQuad" }
ColorAnimation { property: "color"; duration: 500 }
}
}
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
index 4c2ba43..2eb2ceb 100644
--- a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
@@ -24,7 +24,7 @@ Item { id:block
}
}
opacity: 0
- opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } }
+ opacity: Behavior { NumberAnimation { matchProperties:"opacity"; duration: 200 } }
anchors.fill: parent
}
//![2]
diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/velocity/Day.qml
index 030fa13..3a7ffa9 100644
--- a/examples/declarative/velocity/Day.qml
+++ b/examples/declarative/velocity/Day.qml
@@ -71,7 +71,7 @@ Rectangle {
}
transitions: Transition {
- NumberAnimation { properties: "rotation,scale"; duration: 200 }
+ NumberAnimation { matchProperties: "rotation,scale"; duration: 200 }
}
}
}
diff --git a/examples/declarative/webview/autosize.qml b/examples/declarative/webview/autosize.qml
index 74c6844..1614906 100644
--- a/examples/declarative/webview/autosize.qml
+++ b/examples/declarative/webview/autosize.qml
@@ -1,7 +1,7 @@
import Qt 4.6
// The WebView size is determined by the width, height,
-// preferredWidth, and preferredHeight properties.
+// preferredWidth, and preferredHeight matchProperties.
Rectangle {
id: rect
color: "white"
diff --git a/examples/declarative/webview/content/FieldText.qml b/examples/declarative/webview/content/FieldText.qml
index b1c1938..6b1d271 100644
--- a/examples/declarative/webview/content/FieldText.qml
+++ b/examples/declarative/webview/content/FieldText.qml
@@ -149,7 +149,7 @@ Item {
to: "*"
reversible: true
NumberAnimation {
- properties: "opacity,leftMargin,rightMargin"
+ matchProperties: "opacity,leftMargin,rightMargin"
duration: 200
}
ColorAnimation {
diff --git a/examples/declarative/xmldata/yahoonews.qml b/examples/declarative/xmldata/yahoonews.qml
index 7d8b8a2..4add361 100644
--- a/examples/declarative/xmldata/yahoonews.qml
+++ b/examples/declarative/xmldata/yahoonews.qml
@@ -61,8 +61,8 @@ Rectangle {
transitions: Transition {
from: "*"; to: "Details"; reversible: true
SequentialAnimation {
- NumberAnimation { duration: 200; properties: "height"; easing: "easeOutQuad" }
- NumberAnimation { duration: 200; properties: "opacity" }
+ NumberAnimation { duration: 200; matchProperties: "height"; easing: "easeOutQuad" }
+ NumberAnimation { duration: 200; matchProperties: "opacity" }
}
}
}
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 948a084..5110ce8 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -262,11 +262,11 @@ void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation, bool isTopL
void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
{
+ unregisterRunningAnimation(animation);
+
if (!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer)
return;
- unregisterRunningAnimation(animation);
-
int idx = animations.indexOf(animation);
if (idx != -1) {
animations.removeAt(idx);
@@ -347,34 +347,32 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
state = newState;
QWeakPointer<QAbstractAnimation> guard(q);
- q->updateState(oldState, newState);
- if (!guard)
- return;
+ //(un)registration of the animation must always happen before calls to
+ //virtual function (updateState) to ensure a correct state of the timer
+ bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped;
+ if (oldState == QAbstractAnimation::Running) {
+ if (newState == QAbstractAnimation::Paused && hasRegisteredTimer)
+ QUnifiedTimer::instance()->ensureTimerUpdate();
+ //the animation, is not running any more
+ QUnifiedTimer::instance()->unregisterAnimation(q);
+ } else {
+ QUnifiedTimer::instance()->registerAnimation(q, isTopLevel);
+ }
- //this is to be safe if updateState changes the state
- if (state == oldState)
+ q->updateState(oldState, newState);
+ if (!guard || newState != state) //this is to be safe if updateState changes the state
return;
// Notify state change
emit q->stateChanged(oldState, newState);
- if (!guard)
+ if (!guard || newState != state) //this is to be safe if updateState changes the state
return;
switch (state) {
case QAbstractAnimation::Paused:
- if (hasRegisteredTimer)
- // currentTime needs to be updated if pauseTimer is active
- QUnifiedTimer::instance()->ensureTimerUpdate();
- if (!guard)
- return;
- //here we're sure that we were in running state before and that the
- //animation is currently registered
- QUnifiedTimer::instance()->unregisterAnimation(q);
break;
case QAbstractAnimation::Running:
{
- bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped;
- QUnifiedTimer::instance()->registerAnimation(q, isTopLevel);
// this ensures that the value is updated now that the animation is running
if (oldState == QAbstractAnimation::Stopped) {
@@ -389,15 +387,10 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
case QAbstractAnimation::Stopped:
// Leave running state.
int dura = q->duration();
- if (!guard)
- return;
if (deleteWhenStopped)
q->deleteLater();
- if (oldState == QAbstractAnimation::Running)
- QUnifiedTimer::instance()->unregisterAnimation(q);
-
if (dura == -1 || loopCount < 0
|| (oldDirection == QAbstractAnimation::Forward && (oldCurrentTime * (oldCurrentLoop + 1)) == (dura * loopCount))
|| (oldDirection == QAbstractAnimation::Backward && oldCurrentTime == 0)) {
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index c85ef77..97cefd5 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -70,6 +70,8 @@ ListView: wrap -> keyNavigationWraps
ListView: autoHighlight -> highlightFollowsCurrentItem
GridView: wrap -> keyNavigationWraps
GridView: autoHighlight -> highlightFollowsCurrentItem
+Animation: targets -> matchTargets
+Animation: properties -> matchProperties
Additions:
MouseRegion: add "acceptedButtons" property
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
index 77e6db8..a46c2be 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
@@ -389,6 +389,76 @@ void QmlGraphicsItemKeyFilter::componentComplete()
if (m_next) m_next->componentComplete();
}
+
+/*!
+ \qmlclass KeyNavigation
+ \brief The KeyNavigation attached property supports key navigation by arrow keys.
+
+ It is common in key-based UIs to use arrow keys to navigate
+ between focussed items. The KeyNavigation property provides a
+ convenient way of specifying which item will gain focus
+ when an arrow key is pressed. The following example provides
+ key navigation for a 2x2 grid of items.
+
+ \code
+ Grid {
+ columns: 2
+ width: 100; height: 100
+ Rectangle {
+ id: item1
+ focus: true
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ KeyNavigation.right: item2
+ KeyNavigation.down: item3
+ }
+ Rectangle {
+ id: item2
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ KeyNavigation.left: item1
+ KeyNavigation.down: item4
+ }
+ Rectangle {
+ id: item3
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ KeyNavigation.right: item4
+ KeyNavigation.up: item1
+ }
+ Rectangle {
+ id: item4
+ width: 50; height: 50
+ color: focus ? "red" : "lightgray"
+ KeyNavigation.left: item3
+ KeyNavigation.up: item2
+ }
+ }
+ \endcode
+
+ KeyNavigation receives key events after the item it is attached to.
+ If the item accepts an arrow key event, the KeyNavigation
+ attached property will not receive an event for that key.
+
+ If an item has been set for a direction and the KeyNavigation
+ attached property receives the corresponding
+ key press and release events, the events will be accepted by
+ KeyNaviagtion and will not propagate any further.
+
+ \sa {Keys}{Keys attached property}
+*/
+
+/*!
+ \qmlproperty Item KeyNavigation::left
+ \qmlproperty Item KeyNavigation::right
+ \qmlproperty Item KeyNavigation::up
+ \qmlproperty Item KeyNavigation::down
+
+ These properties hold the item to assign focus to
+ when Key_Left, Key_Right, Key_Up or Key_Down are
+ pressed.
+*/
+
class QmlGraphicsKeyNavigationAttachedPrivate : public QObjectPrivate
{
public:
@@ -606,7 +676,7 @@ void QmlGraphicsKeyNavigationAttached::keyReleased(QKeyEvent *event)
See \l {Qt::Key}{Qt.Key} for the list of keyboard codes.
- \sa KeyEvent
+ \sa KeyEvent, {KeyNavigation}{KeyNavigation attached property}
*/
/*!
@@ -1119,7 +1189,7 @@ void QmlGraphicsKeysAttached::keyPressed(QKeyEvent *event)
// If we specifically handle a key then default to accepted
ke.setAccepted(true);
int idx = QmlGraphicsKeysAttached::staticMetaObject.indexOfSignal(keySignal);
- metaObject()->method(idx).invoke(this, Q_ARG(QmlGraphicsKeysAttached, &ke));
+ metaObject()->method(idx).invoke(this, Qt::DirectConnection, Q_ARG(QmlGraphicsKeyEvent*, &ke));
}
}
if (!ke.isAccepted())
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 240f16c..8e92eb4 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -1714,7 +1714,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop,
prop->value, obj, ctxt.incr()));
obj->addValueTypeProperty(prop);
} else {
- COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property access"));
+ COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid grouped property access"));
}
} else {
@@ -1722,7 +1722,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop,
prop->value->metatype =
QmlEnginePrivate::get(engine)->metaObjectForType(prop->type);
if (!prop->value->metatype)
- COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Cannot nest non-QObject property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid grouped property access"));
obj->addGroupedProperty(prop);
@@ -1749,8 +1749,11 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type,
prop->index = idx;
prop->type = p.userType();
- if (prop->value || prop->values.count() != 1)
- COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property use"));
+ if (prop->value)
+ COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Property assignment expected"));
+
+ if (prop->values.count() != 1)
+ COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Single property assignment expected"));
Value *value = prop->values.at(0);
@@ -1758,7 +1761,7 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type,
bool isPropertyValue = output->types.at(value->object->type).type->propertyValueSourceCast() != -1;
bool isPropertyInterceptor = output->types.at(value->object->type).type->propertyValueInterceptorCast() != -1;
if (!isPropertyValue && !isPropertyInterceptor) {
- COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property use"));
+ COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Unexpected object assignment"));
} else {
COMPILE_CHECK(buildObject(value->object, ctxt));
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index bd4c6f7..7c5bc50 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -422,21 +422,6 @@ void QmlAbstractAnimation::setGroup(QmlAnimationGroup *g)
setParent(g);
}
-/*!
- \qmlproperty Object PropertyAction::target
- This property holds an explicit target object to animate.
-
- The exact effect of the \c target property depends on how the animation
- is being used. Refer to the \l animation documentation for details.
-*/
-
-/*!
- \qmlproperty Object PropertyAnimation::target
- This property holds an explicit target object to animate.
-
- The exact effect of the \c target property depends on how the animation
- is being used. Refer to the \l animation documentation for details.
-*/
QObject *QmlAbstractAnimation::target() const
{
Q_D(const QmlAbstractAnimation);
@@ -459,21 +444,6 @@ void QmlAbstractAnimation::setTarget(QObject *o)
emit targetChanged(d->target, d->propertyName);
}
-/*!
- \qmlproperty string PropertyAction::property
- This property holds an explicit property to animated.
-
- The exact effect of the \c property property depends on how the animation
- is being used. Refer to the \l animation documentation for details.
-*/
-
-/*!
- \qmlproperty string PropertyAnimation::property
- This property holds an explicit property to animated.
-
- The exact effect of the \c property property depends on how the animation
- is being used. Refer to the \l animation documentation for details.
-*/
QString QmlAbstractAnimation::property() const
{
Q_D(const QmlAbstractAnimation);
@@ -880,7 +850,7 @@ QML_DEFINE_TYPE(Qt,4,6,ScriptAction,QmlScriptAction)
Set \c thewebview.url to the value set for the destination state:
\code
- PropertyAction { target: thewebview; property: "url" }
+ PropertyAction { matchTargets: thewebview; matchProperties: "url" }
\endcode
The PropertyAction is immediate -
@@ -909,8 +879,33 @@ void QmlPropertyActionPrivate::init()
}
/*!
- \qmlproperty string PropertyAction::properties
- This property holds the properties to be immediately set, comma-separated.
+ \qmlproperty Object PropertyAction::target
+ This property holds an explicit target object to animate.
+
+ The exact effect of the \c target property depends on how the animation
+ is being used. Refer to the \l animation documentation for details.
+*/
+
+/*!
+ \qmlproperty string PropertyAction::property
+ This property holds an explicit property to animated.
+
+ The exact effect of the \c property property depends on how the animation
+ is being used. Refer to the \l animation documentation for details.
+*/
+
+/*!
+ \qmlproperty string PropertyAction::matchProperties
+ This property holds a comma-separated list of property names this action
+ will match against. These names are used in conjunction with matchTargets
+ to create a list of properties that the action will set, assuming those
+ properties have changed.
+
+ This property is typically used for an action appearing as part of a Transition.
+
+ By default, no property names will be matched.
+
+ \sa matchTargets PropertyAnimation::matchProperties
*/
QString QmlPropertyAction::properties() const
{
@@ -928,9 +923,16 @@ void QmlPropertyAction::setProperties(const QString &p)
}
/*!
- \qmlproperty list<Item> PropertyAction::targets
- This property holds the items selected to be affected by this animation (all if not set).
- \sa exclude
+ \qmlproperty list<Object> PropertyAction::matchTargets
+ This property holds a list of objects this action will match against.
+ These objects are used in conjunction with matchProperties to create a list of properties
+ that the action will set, assuming those properties have changed.
+
+ This property is typically used for an action appearing as part of a Transition.
+
+ By default, all changing targets will be matched.
+
+ \sa exclude matchProperties PropertyAnimation::matchTargets
*/
QList<QObject *> *QmlPropertyAction::targets()
{
@@ -939,9 +941,9 @@ QList<QObject *> *QmlPropertyAction::targets()
}
/*!
- \qmlproperty list<Item> PropertyAction::exclude
- This property holds the items not to be affected by this animation.
- \sa targets
+ \qmlproperty list<Object> PropertyAction::exclude
+ This property holds the objects not to be affected by this animation.
+ \sa matchTargets
*/
QList<QObject *> *QmlPropertyAction::exclude()
{
@@ -1014,19 +1016,26 @@ void QmlPropertyAction::transition(QmlStateActions &actions,
QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(','));
for (int ii = 0; ii < props.count(); ++ii)
props[ii] = props.at(ii).trimmed();
- if (!d->propertyName.isEmpty() && !props.contains(d->propertyName))
- props.append(d->propertyName);
-
- bool targetNeedsReset = false;
- if (d->userProperty.isValid() && props.isEmpty() && !target()) {
- props.append(d->userProperty.value.name());
- d->target = d->userProperty.value.object();
- targetNeedsReset = true;
- }
+
+ bool hasSelectors = !props.isEmpty() || !d->targets.isEmpty() || !d->exclude.isEmpty();
+ bool hasTarget = !d->propertyName.isEmpty() || d->target;
+
+ if (hasSelectors && hasTarget) {
+ qmlInfo(tr("matchTargets/matchProperties/exclude and target/property are mutually exclusive."), this);
+ return;
+ }
QmlSetPropertyAnimationAction *data = new QmlSetPropertyAnimationAction;
- QSet<QObject *> objs;
+ if (hasTarget && d->value.isValid()) {
+ Action myAction;
+ myAction.property = d->createProperty(target(), d->propertyName);
+ if (myAction.property.isValid()) {
+ myAction.toValue = d->value;
+ data->actions << myAction;
+ }
+ }
+
for (int ii = 0; ii < actions.count(); ++ii) {
Action &action = actions[ii];
@@ -1038,9 +1047,7 @@ void QmlPropertyAction::transition(QmlStateActions &actions,
if ((d->targets.isEmpty() || d->targets.contains(obj) || (!same && d->targets.contains(sObj))) &&
(!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) &&
- (props.contains(propertyName) || (!same && props.contains(sPropertyName))) &&
- (!target() || target() == obj || (!same && target() == sObj))) {
- objs.insert(obj);
+ (props.contains(propertyName) || (!same && props.contains(sPropertyName)))) {
Action myAction = action;
if (d->value.isValid())
@@ -1049,18 +1056,20 @@ void QmlPropertyAction::transition(QmlStateActions &actions,
modified << action.property;
data->actions << myAction;
action.fromValue = myAction.toValue;
- }
- }
+ } else if (d->userProperty.isValid() &&
+ !hasSelectors && !hasTarget) {
+ if ((d->userProperty.value.object() == obj || (!same && d->userProperty.value.object() == sObj)) &&
+ (d->userProperty.value.name() == propertyName || (!same && d->userProperty.value.name() == sPropertyName))) {
+ //### same as above. merge
+ Action myAction = action;
- if (d->value.isValid() && target() && !objs.contains(target())) {
- QObject *obj = target();
- for (int jj = 0; jj < props.count(); ++jj) {
- Action myAction;
- myAction.property = d->createProperty(obj, props.at(jj));
- if (!myAction.property.isValid())
- continue;
- myAction.toValue = d->value;
- data->actions << myAction;
+ if (d->value.isValid())
+ myAction.toValue = d->value;
+
+ modified << action.property;
+ data->actions << myAction;
+ action.fromValue = myAction.toValue;
+ }
}
}
@@ -1069,8 +1078,6 @@ void QmlPropertyAction::transition(QmlStateActions &actions,
} else {
delete data;
}
- if (targetNeedsReset)
- d->target = 0;
}
QML_DEFINE_TYPE(Qt,4,6,PropertyAction,QmlPropertyAction)
@@ -1222,7 +1229,7 @@ QML_DEFINE_TYPE(Qt,4,6,ParentAction,QmlParentAction)
Animate a set of properties over 200ms, from their values in the start state to
their values in the end state of the transition:
\code
- NumberAnimation { properties: "x,y,scale"; duration: 200 }
+ NumberAnimation { matchProperties: "x,y,scale"; duration: 200 }
\endcode
*/
@@ -1785,11 +1792,47 @@ void QmlPropertyAnimation::setEasing(const QString &e)
}
/*!
- \qmlproperty string PropertyAnimation::properties
- This property holds the properties this animation should be applied to.
+ \qmlproperty Object PropertyAnimation::target
+ This property holds an explicit target object to animate.
+
+ The exact effect of the \c target property depends on how the animation
+ is being used. Refer to the \l animation documentation for details.
+*/
+
+/*!
+ \qmlproperty string PropertyAnimation::property
+ This property holds an explicit property to animated.
+
+ The exact effect of the \c property property depends on how the animation
+ is being used. Refer to the \l animation documentation for details.
+*/
+
+/*!
+ \qmlproperty string PropertyAnimation::matchProperties
+ This property holds a comma-separated list of property names this animation
+ will match against. These names are used in conjunction with matchTargets
+ to create a list of properties that the animation will animate, assuming those
+ properties have changed.
+
+ In the following example, the change in 'x' will be animated by the transition, while
+ the change in 'y' will not.
+ \qml
+ State {
+ PropertyChanges {
+ target: myItem
+ x: 15; y: 15
+ }
+ }
+ Transition {
+ PropertyAnimation {
+ matchProperties: "x"
+ }
+ }
+ \endqml
+
+ This property is typically used for an animation appearing as part of a Transition.
- This is a comma-separated list of properties that should use
- this animation when they change.
+ By default, no property names will be matched.
*/
QString QmlPropertyAnimation::properties() const
{
@@ -1808,9 +1851,37 @@ void QmlPropertyAnimation::setProperties(const QString &prop)
}
/*!
- \qmlproperty list<Item> PropertyAnimation::targets
- This property holds the items selected to be affected by this animation (all if not set).
- \sa exclude
+ \qmlproperty list<Object> PropertyAnimation::matchTargets
+ This property holds a list of objects this animation will match against.
+ These objects are used in conjunction with matchProperties to create a list of properties
+ that the animation will animate, assuming those properties have changed.
+
+ In the following example, the changes to \c myItem will be animated by the transition, while
+ the changes to \c myOtherItem will not.
+ \qml
+ State {
+ PropertyChanges {
+ target: myItem
+ x: 15; y: 15
+ }
+ PropertyChanges {
+ target: myOtherItem
+ x: 30; y: 30
+ }
+ }
+ Transition {
+ PropertyAnimation {
+ matchTargets: myItem
+ matchProperties: "x,y"
+ }
+ }
+ \endqml
+
+ This property is typically used for an animation appearing as part of a Transition.
+
+ By default, all changing targets will be matched.
+
+ \sa exclude matchProperties
*/
QList<QObject *> *QmlPropertyAnimation::targets()
{
@@ -1819,9 +1890,9 @@ QList<QObject *> *QmlPropertyAnimation::targets()
}
/*!
- \qmlproperty list<Item> PropertyAnimation::exclude
+ \qmlproperty list<Object> PropertyAnimation::exclude
This property holds the items not to be affected by this animation.
- \sa targets
+ \sa matchTargets
*/
QList<QObject *> *QmlPropertyAnimation::exclude()
{
@@ -1933,24 +2004,37 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(','));
for (int ii = 0; ii < props.count(); ++ii)
props[ii] = props.at(ii).trimmed();
- if (!d->propertyName.isEmpty() && !props.contains(d->propertyName))
- props.append(d->propertyName);
- bool useType = (props.isEmpty() && d->defaultToInterpolatorType) ? true : false;
+ bool hasSelectors = !props.isEmpty() || !d->targets.isEmpty() || !d->exclude.isEmpty();
+ bool hasTarget = !d->propertyName.isEmpty() || d->target;
- bool targetNeedsReset = false;
- if (d->userProperty.isValid() && props.isEmpty() && !target()) {
- props.append(d->userProperty.value.name());
- d->target = d->userProperty.value.object();
- targetNeedsReset = true;
+ if (hasSelectors && hasTarget) {
+ qmlInfo(tr("matchTargets/matchProperties/exclude and target/property are mutually exclusive."), this);
+ return;
}
+ bool useType = (props.isEmpty() && d->propertyName.isEmpty() && d->defaultToInterpolatorType) ? true : false;
+
PropertyUpdater *data = new PropertyUpdater;
data->interpolatorType = d->interpolatorType;
data->interpolator = d->interpolator;
data->reverse = direction == Backward ? true : false;
- QSet<QObject *> objs;
+ //an explicit animation has been specified
+ if (hasTarget && d->toIsDefined) {
+ Action myAction;
+ myAction.property = d->createProperty(target(), d->propertyName);
+ if (myAction.property.isValid()) {
+ if (d->fromIsDefined) {
+ d->convertVariant(d->from, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
+ myAction.fromValue = d->from;
+ }
+ d->convertVariant(d->to, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
+ myAction.toValue = d->to;
+ data->actions << myAction;
+ }
+ }
+
for (int ii = 0; ii < actions.count(); ++ii) {
Action &action = actions[ii];
@@ -1963,16 +2047,13 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
if ((d->targets.isEmpty() || d->targets.contains(obj) || (!same && d->targets.contains(sObj))) &&
(!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) &&
(props.contains(propertyName) || (!same && props.contains(sPropertyName))
- || (useType && action.property.propertyType() == d->interpolatorType)) &&
- (!target() || target() == obj || (!same && target() == sObj))) {
- objs.insert(obj);
+ || (useType && action.property.propertyType() == d->interpolatorType))) {
Action myAction = action;
- if (d->fromIsDefined) {
+ if (d->fromIsDefined)
myAction.fromValue = d->from;
- } else {
+ else
myAction.fromValue = QVariant();
- }
if (d->toIsDefined)
myAction.toValue = d->to;
@@ -1983,25 +2064,29 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
data->actions << myAction;
action.fromValue = myAction.toValue;
- }
- }
-
- if (d->toIsDefined && target() && !objs.contains(target())) {
- QObject *obj = target();
- for (int jj = 0; jj < props.count(); ++jj) {
- Action myAction;
- myAction.property = d->createProperty(obj, props.at(jj));
- if (!myAction.property.isValid())
- continue;
-
- if (d->fromIsDefined) {
- d->convertVariant(d->from, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
- myAction.fromValue = d->from;
- }
- d->convertVariant(d->to, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
- myAction.toValue = d->to;
- data->actions << myAction;
- }
+ } else if (d->userProperty.isValid() &&
+ !hasSelectors && !hasTarget) {
+ if ((d->userProperty.value.object() == obj || (!same && d->userProperty.value.object() == sObj)) &&
+ (d->userProperty.value.name() == propertyName || (!same && d->userProperty.value.name() == sPropertyName))) {
+ //### same as above. merge
+ Action myAction = action;
+
+ if (d->fromIsDefined)
+ myAction.fromValue = d->from;
+ else
+ myAction.fromValue = QVariant();
+ if (d->toIsDefined)
+ myAction.toValue = d->to;
+
+ d->convertVariant(myAction.fromValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
+ d->convertVariant(myAction.toValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType());
+
+ modified << action.property;
+
+ data->actions << myAction;
+ action.fromValue = myAction.toValue;
+ }
+ }
}
if (data->actions.count()) {
@@ -2009,8 +2094,6 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
} else {
delete data;
}
- if (targetNeedsReset)
- d->target = 0;
}
QML_DEFINE_TYPE(Qt,4,6,PropertyAnimation,QmlPropertyAnimation)
diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h
index 214bab9..3a9839e 100644
--- a/src/declarative/util/qmlanimation_p.h
+++ b/src/declarative/util/qmlanimation_p.h
@@ -191,8 +191,8 @@ class QmlPropertyAction : public QmlAbstractAnimation
Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged)
- Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged)
- Q_PROPERTY(QList<QObject *>* targets READ targets)
+ Q_PROPERTY(QString matchProperties READ properties WRITE setProperties NOTIFY propertiesChanged)
+ Q_PROPERTY(QList<QObject *>* matchTargets READ targets)
Q_PROPERTY(QList<QObject *>* exclude READ exclude)
Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
@@ -260,8 +260,8 @@ class Q_AUTOTEST_EXPORT QmlPropertyAnimation : public QmlAbstractAnimation
Q_PROPERTY(QString easing READ easing WRITE setEasing NOTIFY easingChanged)
Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged)
- Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged)
- Q_PROPERTY(QList<QObject *>* targets READ targets)
+ Q_PROPERTY(QString matchProperties READ properties WRITE setProperties NOTIFY propertiesChanged)
+ Q_PROPERTY(QList<QObject *>* matchTargets READ targets)
Q_PROPERTY(QList<QObject *>* exclude READ exclude)
public:
diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp
index 0aa0747..8ee9059 100644
--- a/src/declarative/util/qmltimer.cpp
+++ b/src/declarative/util/qmltimer.cpp
@@ -176,6 +176,11 @@ void QmlTimer::setRepeating(bool repeating)
/*!
\qmlproperty bool Timer::triggeredOnStart
+ When the Timer is started the first trigger is normally after the specified
+ interval has elapsed. It is sometimes desireable to trigger immediately
+ when the timer is started, for example to establish an initial
+ state.
+
If \a triggeredOnStart is true, the timer will be triggered immediately
when started, and subsequently at the specified interval. Note that for
a Timer with \e repeat set to false, this will result in the timer being
diff --git a/tests/auto/declarative/anchors/data/anchors.qml b/tests/auto/declarative/anchors/data/anchors.qml
index 377dd2d..765e5b6 100644
--- a/tests/auto/declarative/anchors/data/anchors.qml
+++ b/tests/auto/declarative/anchors/data/anchors.qml
@@ -114,4 +114,31 @@ Rectangle {
y: 70; width: 10; height: 10
anchors.horizontalCenter: parent.left
}
+ Rectangle {
+ id: Rect22; objectName: "Rect22"
+ width: 10; height: 10
+ anchors.centerIn: MasterRect
+ }
+ Rectangle {
+ id: Rect23; objectName: "Rect23"
+ anchors.left: MasterRect.left
+ anchors.leftMargin: 5
+ anchors.right: MasterRect.right
+ anchors.rightMargin: 5
+ anchors.top: MasterRect.top
+ anchors.topMargin: 5
+ anchors.bottom: MasterRect.bottom
+ anchors.bottomMargin: 5
+ }
+ Text {
+ id: text1; objectName: "text1"
+ y: 200;
+ text: "Hello"
+ }
+ Text {
+ id: text2; objectName: "text2"
+ anchors.baseline: text1.baseline
+ anchors.left: text1.right
+ text: "World"
+ }
}
diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp
index 8abf04f..c3a857c 100644
--- a/tests/auto/declarative/anchors/tst_anchors.cpp
+++ b/tests/auto/declarative/anchors/tst_anchors.cpp
@@ -43,6 +43,7 @@
#include <QtDeclarative/qmlcomponent.h>
#include <QtDeclarative/qmlview.h>
#include <private/qmlgraphicsrectangle_p.h>
+#include <private/qmlgraphicstext_p.h>
#include <QtDeclarative/private/qmlgraphicsanchors_p_p.h>
@@ -131,6 +132,21 @@ void tst_anchors::basicAnchors()
QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("Rect20"))->x(), 235.0);
QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("Rect21"))->x(), -5.0);
+ //centerIn
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("Rect22"))->x(), 69.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("Rect22"))->y(), 5.0);
+
+ //margins
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("Rect23"))->x(), 31.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("Rect23"))->y(), 5.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("Rect23"))->width(), 86.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("Rect23"))->height(), 10.0);
+
+ //baseline
+ QmlGraphicsText *text1 = findItem<QmlGraphicsText>(view->root(), QLatin1String("text1"));
+ QmlGraphicsText *text2 = findItem<QmlGraphicsText>(view->root(), QLatin1String("text2"));
+ QCOMPARE(text1->y(), text2->y());
+
delete view;
}
diff --git a/tests/auto/declarative/animations/data/badproperty1.qml b/tests/auto/declarative/animations/data/badproperty1.qml
index 78da34a..df1a98d 100644
--- a/tests/auto/declarative/animations/data/badproperty1.qml
+++ b/tests/auto/declarative/animations/data/badproperty1.qml
@@ -19,6 +19,6 @@ Rectangle {
PropertyChanges { target: MyRect; border.color: "blue" }
}
transitions: Transition {
- ColorAnimation { target: MyRect; to: "red"; properties: "pen.colr"; duration: 1000 }
+ ColorAnimation { target: MyRect; to: "red"; property: "pen.colr"; duration: 1000 }
}
}
diff --git a/tests/auto/declarative/animations/data/badtype4.qml b/tests/auto/declarative/animations/data/badtype4.qml
index 0c0a636..5db6c17 100644
--- a/tests/auto/declarative/animations/data/badtype4.qml
+++ b/tests/auto/declarative/animations/data/badtype4.qml
@@ -20,7 +20,7 @@ Rectangle {
}
transitions: Transition {
//comment out each in turn to make sure each only animates the relevant property
- ColorAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
- NumberAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
+ ColorAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color
+ NumberAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color
}
}
diff --git a/tests/auto/declarative/animations/data/dotproperty.qml b/tests/auto/declarative/animations/data/dotproperty.qml
index ee076c2..3ddb002 100644
--- a/tests/auto/declarative/animations/data/dotproperty.qml
+++ b/tests/auto/declarative/animations/data/dotproperty.qml
@@ -16,9 +16,9 @@ Rectangle {
}
states: State {
name: "state1"
- PropertyChanges { target: MyRect; pen.color: "blue" }
+ PropertyChanges { target: MyRect; border.color: "blue" }
}
transitions: Transition {
- ColorAnimation { properties: "pen.color"; duration: 1000 }
+ ColorAnimation { matchProperties: "border.color"; duration: 1000 }
}
}
diff --git a/tests/auto/declarative/animations/data/mixedtype1.qml b/tests/auto/declarative/animations/data/mixedtype1.qml
index ed50582..5ecf14f 100644
--- a/tests/auto/declarative/animations/data/mixedtype1.qml
+++ b/tests/auto/declarative/animations/data/mixedtype1.qml
@@ -19,6 +19,6 @@ Rectangle {
PropertyChanges { target: MyRect; x: 200; border.width: 10 }
}
transitions: Transition {
- PropertyAnimation { properties: "x,border.width"; duration: 1000 } //x is real, border.width is int
+ PropertyAnimation { matchProperties: "x,border.width"; duration: 1000 } //x is real, border.width is int
}
}
diff --git a/tests/auto/declarative/animations/data/mixedtype2.qml b/tests/auto/declarative/animations/data/mixedtype2.qml
index 4854c2e..645f1d0 100644
--- a/tests/auto/declarative/animations/data/mixedtype2.qml
+++ b/tests/auto/declarative/animations/data/mixedtype2.qml
@@ -19,6 +19,6 @@ Rectangle {
PropertyChanges { target: MyRect; x: 200; color: "blue" }
}
transitions: Transition {
- PropertyAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color
+ PropertyAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color
}
}
diff --git a/tests/auto/declarative/animations/data/properties.qml b/tests/auto/declarative/animations/data/properties.qml
new file mode 100644
index 0000000..a8023b4
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { to: 200; running: true; }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/properties2.qml b/tests/auto/declarative/animations/data/properties2.qml
new file mode 100644
index 0000000..aab7661
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties2.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { matchTargets: theRect; matchProperties: "x"; to: 200; running: true }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/properties3.qml b/tests/auto/declarative/animations/data/properties3.qml
new file mode 100644
index 0000000..fd21a85
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties3.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { target: theRect; property: "x"; to: 300; running: true }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/properties4.qml b/tests/auto/declarative/animations/data/properties4.qml
new file mode 100644
index 0000000..e23651c
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties4.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { target: theRect; property: "y"; to: 200; running: true }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/properties5.qml b/tests/auto/declarative/animations/data/properties5.qml
new file mode 100644
index 0000000..25c9866
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties5.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { matchTargets: theRect; matchProperties: "y"; to: 200; running: true }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition.qml b/tests/auto/declarative/animations/data/propertiesTransition.qml
new file mode 100644
index 0000000..75603b9
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { matchTargets: theRect; matchProperties: "x" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition2.qml b/tests/auto/declarative/animations/data/propertiesTransition2.qml
new file mode 100644
index 0000000..ae59157
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition2.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { target: theRect; property: "y"; to: 200 }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition3.qml b/tests/auto/declarative/animations/data/propertiesTransition3.qml
new file mode 100644
index 0000000..eedba7b
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition3.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { matchTargets: theRect; matchProperties: "y" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition4.qml b/tests/auto/declarative/animations/data/propertiesTransition4.qml
new file mode 100644
index 0000000..301f796
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition4.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { target: theRect; matchProperties: "x" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition5.qml b/tests/auto/declarative/animations/data/propertiesTransition5.qml
new file mode 100644
index 0000000..565c519
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition5.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { matchTargets: theRect; property: "x" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition6.qml b/tests/auto/declarative/animations/data/propertiesTransition6.qml
new file mode 100644
index 0000000..b541dab
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition6.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { matchTargets: theItem; matchProperties: "x" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp
index ca383bb..a4402cb 100644
--- a/tests/auto/declarative/animations/tst_animations.cpp
+++ b/tests/auto/declarative/animations/tst_animations.cpp
@@ -59,6 +59,8 @@ private slots:
void badTypes();
void badProperties();
void mixedTypes();
+ void properties();
+ void propertiesTransition();
};
#define QTIMED_COMPARE(lhs, rhs) do { \
@@ -198,11 +200,12 @@ void tst_animations::badProperties()
{
QmlEngine engine;
QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\"");
QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
QVERIFY(rect);
- QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\"");
- rect->setState("state1");
+ //### should we warn here are well?
+ //rect->setState("state1");
}
}
@@ -244,6 +247,143 @@ void tst_animations::mixedTypes()
}
}
+void tst_animations::properties()
+{
+ const int waitDuration = 300;
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties2.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties3.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(300));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties4.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties5.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ QTIMED_COMPARE(myRect->y(),qreal(100));
+ }
+}
+
+void tst_animations::propertiesTransition()
+{
+ const int waitDuration = 300;
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ rect->setState("moved");
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition2.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ rect->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ QCOMPARE(myRect->y(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition3.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlNumberAnimation (file:///home/brasser/depot/kinetic-declarativeui/qt/tests/auto/declarative/animations/data/propertiesTransition4.qml:22:9) targets/properties/exclude and target/property are mutually exclusive.");
+ rect->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition4.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlNumberAnimation (file:///home/brasser/depot/kinetic-declarativeui/qt/tests/auto/declarative/animations/data/propertiesTransition5.qml:22:9) targets/properties/exclude and target/property are mutually exclusive.");
+ rect->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition5.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ //### should output warning at some point -- theItem doesn't exist
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ rect->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ }
+}
+
QTEST_MAIN(tst_animations)
#include "tst_animations.moc"
diff --git a/tests/auto/declarative/behaviors/data/nonSelecting.qml b/tests/auto/declarative/behaviors/data/nonSelecting.qml
index ae9a9f5..ba36d93 100644
--- a/tests/auto/declarative/behaviors/data/nonSelecting.qml
+++ b/tests/auto/declarative/behaviors/data/nonSelecting.qml
@@ -8,7 +8,7 @@ Rectangle {
width: 100; height: 100; color: "green"
x: Behavior {
objectName: "MyBehavior";
- NumberAnimation { target: rect; property: "y"; duration: 200; }
+ NumberAnimation { target: rect; property: "x"; duration: 200; }
}
}
MouseRegion {
diff --git a/tests/auto/declarative/behaviors/data/nonSelecting2.qml b/tests/auto/declarative/behaviors/data/nonSelecting2.qml
new file mode 100644
index 0000000..e9849eb
--- /dev/null
+++ b/tests/auto/declarative/behaviors/data/nonSelecting2.qml
@@ -0,0 +1,26 @@
+import Qt 4.6
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: rect
+ objectName: "MyRect"
+ width: 100; height: 100; color: "green"
+ x: Behavior {
+ objectName: "MyBehavior";
+ NumberAnimation { matchTargets: rect; matchProperties: "y"; duration: 200; }
+ }
+ }
+ MouseRegion {
+ id: clicker
+ anchors.fill: parent
+ }
+ states: State {
+ name: "moved"
+ when: clicker.pressed
+ PropertyChanges {
+ target: rect
+ x: 200
+ }
+ }
+}
diff --git a/tests/auto/declarative/behaviors/tst_behaviors.cpp b/tests/auto/declarative/behaviors/tst_behaviors.cpp
index da910d9..6343968 100644
--- a/tests/auto/declarative/behaviors/tst_behaviors.cpp
+++ b/tests/auto/declarative/behaviors/tst_behaviors.cpp
@@ -208,14 +208,27 @@ void tst_behaviors::emptyBehavior()
void tst_behaviors::nonSelectingBehavior()
{
- QmlEngine engine;
- QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting.qml"));
- QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
- QVERIFY(rect);
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
- rect->setState("moved");
- qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
- QCOMPARE(x, qreal(200)); //should change immediately
+ rect->setState("moved");
+ qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
+ QCOMPARE(x, qreal(200)); //should change immediately
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting2.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ rect->setState("moved");
+ qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x();
+ QCOMPARE(x, qreal(200)); //should change immediately
+ }
}
void tst_behaviors::reassignedAnimation()
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
index 6533cfd..64672f6 100644
--- a/tests/auto/declarative/declarative.pro
+++ b/tests/auto/declarative/declarative.pro
@@ -7,7 +7,7 @@ SUBDIRS += \
datetimeformatter \ # Cover
examples \
layouts \ # Cover
- listview \ # Cover
+ qmlgraphicslistview \ # Cover
qmlgraphicsgridview \ # Cover
numberformatter \ # Cover
pathview \ # Cover
@@ -22,6 +22,7 @@ SUBDIRS += \
qmlecmascript \ # Cover
qmlerror \ # Cover
qmlfontloader \ # Cover
+ qmlgraphicsitem \ # Cover
qmlgraphicsborderimage \ # Cover
qmlgraphicsparticles \ # Cover
qmlgraphicstext \ # Cover
diff --git a/tests/auto/declarative/layouts/data/grid-animated.qml b/tests/auto/declarative/layouts/data/grid-animated.qml
index 9edccaf..6b128ce 100644
--- a/tests/auto/declarative/layouts/data/grid-animated.qml
+++ b/tests/auto/declarative/layouts/data/grid-animated.qml
@@ -7,17 +7,17 @@ Item {
columns: 3
add: Transition {
NumberAnimation {
- properties: "x,y"; from: -100
+ matchProperties: "x,y"; from: -100
}
}
remove: Transition {
NumberAnimation {
- properties: "x,y"; to: -100
+ matchProperties: "x,y"; to: -100
}
}
move: Transition {
NumberAnimation {
- properties: "x,y";
+ matchProperties: "x,y";
}
}
Rectangle {
diff --git a/tests/auto/declarative/layouts/data/horizontal-animated.qml b/tests/auto/declarative/layouts/data/horizontal-animated.qml
index f757d18..c29d6df 100644
--- a/tests/auto/declarative/layouts/data/horizontal-animated.qml
+++ b/tests/auto/declarative/layouts/data/horizontal-animated.qml
@@ -6,17 +6,17 @@ Item {
Row {
add: Transition {
NumberAnimation {
- properties: "x"; from: -100
+ matchProperties: "x"; from: -100
}
}
remove: Transition {
NumberAnimation {
- properties: "x"; to: -100
+ matchProperties: "x"; to: -100
}
}
move: Transition {
NumberAnimation {
- properties: "x";
+ matchProperties: "x";
}
}
Rectangle {
diff --git a/tests/auto/declarative/layouts/data/vertical-animated.qml b/tests/auto/declarative/layouts/data/vertical-animated.qml
index f52a78a..fcbc5f7 100644
--- a/tests/auto/declarative/layouts/data/vertical-animated.qml
+++ b/tests/auto/declarative/layouts/data/vertical-animated.qml
@@ -6,17 +6,17 @@ Item {
Column {
add: Transition {
NumberAnimation {
- properties: "y"; from: -100
+ matchProperties: "y"; from: -100
}
}
remove: Transition {
NumberAnimation {
- properties: "y"; to: -100
+ matchProperties: "y"; to: -100
}
}
move: Transition {
NumberAnimation {
- properties: "y";
+ matchProperties: "y";
}
}
Rectangle {
diff --git a/tests/auto/declarative/qmlgraphicsitem/data/keys.qml b/tests/auto/declarative/qmlgraphicsitem/data/keys.qml
new file mode 100644
index 0000000..7c16559
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicsitem/data/keys.qml
@@ -0,0 +1,15 @@
+import Qt 4.6
+
+Item {
+ focus: true
+ Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers)
+ Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; }
+ Keys.onReturnPressed: keysTestObject.keyPress(event.key, "Return", event.modifiers)
+ Keys.forwardTo: [ item2 ]
+
+ Item {
+ id: item2
+ Keys.onPressed: keysTestObject.forwardedKey(event.key)
+ Keys.onReleased: keysTestObject.forwardedKey(event.key)
+ }
+}
diff --git a/tests/auto/declarative/qmlgraphicsitem/qmlgraphicsitem.pro b/tests/auto/declarative/qmlgraphicsitem/qmlgraphicsitem.pro
new file mode 100644
index 0000000..ddabf9a
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicsitem/qmlgraphicsitem.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qmlgraphicsitem.cpp
+
+DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp b/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp
new file mode 100644
index 0000000..b3b5374
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 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/qmlengine.h>
+#include <QtDeclarative/qmlcomponent.h>
+#include <QtDeclarative/qmlcontext.h>
+#include <QtDeclarative/qmlview.h>
+#include <qmlgraphicsitem.h>
+
+class tst_QmlGraphicsItem : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_QmlGraphicsItem();
+
+private slots:
+ void keys();
+ void keyNavigation();
+
+private:
+ template<typename T>
+ T *findItem(QmlGraphicsItem *parent, const QString &objectName);
+};
+
+class KeysTestObject : public QObject
+{
+ Q_OBJECT
+public:
+ KeysTestObject() : mKey(0), mModifiers(0), mForwardedKey(0) {}
+
+ void reset() {
+ mKey = 0;
+ mText = QString();
+ mModifiers = 0;
+ mForwardedKey = 0;
+ }
+
+public slots:
+ void keyPress(int key, QString text, int modifiers) {
+ mKey = key;
+ mText = text;
+ mModifiers = modifiers;
+ }
+ void keyRelease(int key, QString text, int modifiers) {
+ mKey = key;
+ mText = text;
+ mModifiers = modifiers;
+ }
+ void forwardedKey(int key) {
+ mForwardedKey = key;
+ }
+
+public:
+ int mKey;
+ QString mText;
+ int mModifiers;
+ int mForwardedKey;
+
+private:
+};
+
+
+tst_QmlGraphicsItem::tst_QmlGraphicsItem()
+{
+}
+
+void tst_QmlGraphicsItem::keys()
+{
+ QmlView *canvas = new QmlView(0);
+ canvas->setFixedSize(240,320);
+
+ canvas->setUrl(QUrl("file://" SRCDIR "/data/keys.qml"));
+
+ KeysTestObject *testObject = new KeysTestObject;
+ canvas->rootContext()->setContextProperty("keysTestObject", testObject);
+
+ canvas->execute();
+ canvas->show();
+ qApp->processEvents();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mText, QLatin1String("A"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(!key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::ShiftModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mText, QLatin1String("A"));
+ QVERIFY(testObject->mModifiers == Qt::ShiftModifier);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_Return));
+ QCOMPARE(testObject->mForwardedKey, int(Qt::Key_Return));
+ QCOMPARE(testObject->mText, QLatin1String("Return"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(key.isAccepted());
+
+ delete canvas;
+ delete testObject;
+}
+
+void tst_QmlGraphicsItem::keyNavigation()
+{
+ QmlView *canvas = new QmlView(0);
+ canvas->setFixedSize(240,320);
+
+ canvas->setUrl(QUrl("file://" SRCDIR "/data/keynavigation.qml"));
+ canvas->execute();
+ canvas->show();
+ qApp->processEvents();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QmlGraphicsItem *item = findItem<QmlGraphicsItem>(canvas->root(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasFocus());
+
+ // right
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QmlGraphicsItem>(canvas->root(), "item2");
+ QVERIFY(item);
+ QVERIFY(item->hasFocus());
+
+ // down
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QmlGraphicsItem>(canvas->root(), "item4");
+ QVERIFY(item);
+ QVERIFY(item->hasFocus());
+
+ // left
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QmlGraphicsItem>(canvas->root(), "item3");
+ QVERIFY(item);
+ QVERIFY(item->hasFocus());
+
+ // up
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QmlGraphicsItem>(canvas->root(), "item1");
+ QVERIFY(item);
+ QVERIFY(item->hasFocus());
+}
+
+template<typename T>
+T *tst_QmlGraphicsItem::findItem(QmlGraphicsItem *parent, const QString &objectName)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->QGraphicsObject::children().count() << "children";
+ for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) {
+ QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(parent->QGraphicsObject::children().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName))
+ return static_cast<T*>(item);
+ item = findItem<T>(item, objectName);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
+
+
+
+QTEST_MAIN(tst_QmlGraphicsItem)
+
+#include "tst_qmlgraphicsitem.moc"
diff --git a/tests/auto/declarative/listview/data/listview-enforcerange.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml
index 46fddae..46fddae 100644
--- a/tests/auto/declarative/listview/data/listview-enforcerange.qml
+++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml
diff --git a/tests/auto/declarative/listview/data/listview-sections.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml
index 56700be..56700be 100644
--- a/tests/auto/declarative/listview/data/listview-sections.qml
+++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml
diff --git a/tests/auto/declarative/listview/data/listview.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml
index b7b838b..b7b838b 100644
--- a/tests/auto/declarative/listview/data/listview.qml
+++ b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml
diff --git a/tests/auto/declarative/listview/listview.pro b/tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro
index 23b0706..f00de39 100644
--- a/tests/auto/declarative/listview/listview.pro
+++ b/tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
contains(QT_CONFIG,declarative): QT += declarative
macx:CONFIG -= app_bundle
-SOURCES += tst_listview.cpp
+SOURCES += tst_qmlgraphicslistview.cpp
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp
index 5575ace..9f904b8 100644
--- a/tests/auto/declarative/listview/tst_listview.cpp
+++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp
@@ -850,4 +850,4 @@ QList<T*> tst_QmlGraphicsListView::findItems(QmlGraphicsItem *parent, const QStr
QTEST_MAIN(tst_QmlGraphicsListView)
-#include "tst_listview.moc"
+#include "tst_qmlgraphicslistview.moc"
diff --git a/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml
index 50723a3..c86c96b 100644
--- a/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml
+++ b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml
@@ -23,6 +23,7 @@ MyTypeObject {
boolProperty: true
variantProperty: "Hello World!"
vectorProperty: "10,1,2.2"
+ urlProperty: "main.qml"
objectProperty: MyTypeObject { intProperty: 8 }
}
diff --git a/tests/auto/declarative/qmllanguage/data/attachedProperties.qml b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml
index 8343754..fec96cc 100644
--- a/tests/auto/declarative/qmllanguage/data/attachedProperties.qml
+++ b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml
@@ -1,5 +1,8 @@
import Test 1.0
+import Test 1.0 as Namespace
import Qt 4.6
+
Object {
MyQmlObject.value: 10
+ Namespace.MyQmlObject.value2: 13
}
diff --git a/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt
index e56ad3a..3074823 100644
--- a/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt
@@ -1 +1 @@
-3:5:Invalid property access
+3:5:Invalid grouped property access
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt
new file mode 100644
index 0000000..68fe671
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt
@@ -0,0 +1 @@
+5:17:Cannot assign to non-existant property "foo"
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml
new file mode 100644
index 0000000..e99c635
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import Qt 4.6
+
+Object {
+ MyQmlObject.foo: 10
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt
new file mode 100644
index 0000000..7f630f4
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt
@@ -0,0 +1 @@
+5:15:Non-existant attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml
new file mode 100644
index 0000000..8f987ce
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml
@@ -0,0 +1,6 @@
+import Test 1.0 as Namespace
+import Qt 4.6
+
+Object {
+ Namespace.MadeUpClass.foo: 10
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt
new file mode 100644
index 0000000..fee5050
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt
@@ -0,0 +1 @@
+5:15:Not an attached property name
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml
new file mode 100644
index 0000000..18770fc
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml
@@ -0,0 +1,7 @@
+import Test 1.0 as Namespace
+import Qt 4.6
+
+Object {
+ Namespace.madeUpClass.foo: 10
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt
new file mode 100644
index 0000000..9f06e07
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt
@@ -0,0 +1 @@
+5:27:Cannot assign to non-existant property "foo"
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml
new file mode 100644
index 0000000..3c9ae5b
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml
@@ -0,0 +1,6 @@
+import Test 1.0 as Namespace
+import Qt 4.6
+
+Object {
+ Namespace.MyQmlObject.foo: 10
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt
new file mode 100644
index 0000000..05161c4
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt
@@ -0,0 +1 @@
+5:5:Invalid attached object assignment
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml
new file mode 100644
index 0000000..e9405a4
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+import Qt 4.6
+
+Object {
+ MyQmlObject: 10
+}
+
+
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt
new file mode 100644
index 0000000..a208bcf
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt
@@ -0,0 +1 @@
+5:15:Invalid attached object assignment
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml
new file mode 100644
index 0000000..6fbf718
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml
@@ -0,0 +1,7 @@
+import Test 1.0 as Namespace
+import Qt 4.6
+
+Object {
+ Namespace.MyQmlObject: 10
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt
new file mode 100644
index 0000000..05161c4
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt
@@ -0,0 +1 @@
+5:5:Invalid attached object assignment
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml
new file mode 100644
index 0000000..1827a16
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import Qt 4.6
+
+Object {
+ MyQmlObject: Object {}
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt
new file mode 100644
index 0000000..e232b23
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt
@@ -0,0 +1 @@
+5:5:Non-existant attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml
new file mode 100644
index 0000000..5c7f0ec
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import Qt 4.6
+
+Object {
+ Test.MyQmlObject: Object {}
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt
new file mode 100644
index 0000000..e232b23
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt
@@ -0,0 +1 @@
+5:5:Non-existant attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml
new file mode 100644
index 0000000..841cc08
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+import Qt 4.6
+
+Object {
+ MyTypeObject.foo: 10
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt
new file mode 100644
index 0000000..7f630f4
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt
@@ -0,0 +1 @@
+5:15:Non-existant attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml
new file mode 100644
index 0000000..f1b4b96
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml
@@ -0,0 +1,6 @@
+import Test 1.0 as Namespace
+import Qt 4.6
+
+Object {
+ Namespace.MyTypeObject.foo: 10
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt
new file mode 100644
index 0000000..e232b23
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt
@@ -0,0 +1 @@
+5:5:Non-existant attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml
new file mode 100644
index 0000000..99c4a5c
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+import Qt 4.6
+
+Object {
+ MadeUpClass.foo: 10
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt
index 7c00ce4..810fd31 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt
@@ -1 +1 @@
-5:5:Invalid property access
+5:5:Invalid grouped property access
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt
index 7c00ce4..810fd31 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt
@@ -1 +1 @@
-5:5:Invalid property access
+5:5:Invalid grouped property access
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt
new file mode 100644
index 0000000..f6d6f29
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt
@@ -0,0 +1 @@
+4:5:Invalid grouped property access
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml
new file mode 100644
index 0000000..0bbfc4f
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyQmlObject {
+ customType.x: 10
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt
new file mode 100644
index 0000000..19934fa
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt
@@ -0,0 +1 @@
+4:5:Cannot assign to non-existant property "foo"
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml
new file mode 100644
index 0000000..134fef9
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyQmlObject {
+ foo.x: 10
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt
new file mode 100644
index 0000000..2c8a970
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt
@@ -0,0 +1 @@
+4:18:Property assignment expected
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml
new file mode 100644
index 0000000..55cefe6
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.x.foo: 100
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt
new file mode 100644
index 0000000..8331725
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt
@@ -0,0 +1 @@
+5:18:Single property assignment expected
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml
new file mode 100644
index 0000000..9ec33ab
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.x: 100
+ rectProperty.x: 101
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt
new file mode 100644
index 0000000..4a7e383
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt
@@ -0,0 +1 @@
+4:-1:Cannot set properties on nullGrouped as it is null
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml
new file mode 100644
index 0000000..b77fb90
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ nullGrouped.script: print(1921)
+}
diff --git a/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt
new file mode 100644
index 0000000..dfaa218
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt
@@ -0,0 +1 @@
+4:18:Cannot assign to non-existant property "foo"
diff --git a/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml
new file mode 100644
index 0000000..9a0fa6a
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.foo: 9
+}
diff --git a/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt
new file mode 100644
index 0000000..db7d9c0
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt
@@ -0,0 +1 @@
+4:18:Unexpected object assignment
diff --git a/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml
new file mode 100644
index 0000000..9924773
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyTypeObject {
+ rectProperty.x: MyTypeObject {}
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt
new file mode 100644
index 0000000..44768e3
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt
@@ -0,0 +1 @@
+3:18:Invalid property assignment: url expected
diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.15.qml b/tests/auto/declarative/qmllanguage/data/wrongType.15.qml
new file mode 100644
index 0000000..633a5ba
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/wrongType.15.qml
@@ -0,0 +1,4 @@
+import Test 1.0
+MyTypeObject {
+ urlProperty: 12
+}
diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h
index e654faa..b251f87 100644
--- a/tests/auto/declarative/qmllanguage/testtypes.h
+++ b/tests/auto/declarative/qmllanguage/testtypes.h
@@ -80,14 +80,19 @@ class MyAttachedObject : public QObject
{
Q_OBJECT
Q_PROPERTY(int value READ value WRITE setValue)
+ Q_PROPERTY(int value2 READ value2 WRITE setValue2)
public:
- MyAttachedObject(QObject *parent) : QObject(parent), m_value(0) {}
+ MyAttachedObject(QObject *parent) : QObject(parent), m_value(0), m_value2(0) {}
int value() const { return m_value; }
void setValue(int v) { m_value = v; }
+ int value2() const { return m_value2; }
+ void setValue2(int v) { m_value2 = v; }
+
private:
int m_value;
+ int m_value2;
};
class MyQmlObject : public QObject, public MyInterface, public QmlParserStatus
@@ -201,9 +206,11 @@ class MyTypeObject : public QObject
Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty);
Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty);
Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty);
+ Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty);
Q_PROPERTY(QmlScriptString scriptProperty READ scriptProperty WRITE setScriptProperty);
Q_PROPERTY(MyGroupedObject *grouped READ grouped CONSTANT);
+ Q_PROPERTY(MyGroupedObject *nullGrouped READ nullGrouped CONSTANT);
public:
MyTypeObject()
@@ -413,6 +420,14 @@ public:
vectorPropertyValue = v;
}
+ QUrl urlPropertyValue;
+ QUrl urlProperty() const {
+ return urlPropertyValue;
+ }
+ void setUrlProperty(const QUrl &v) {
+ urlPropertyValue = v;
+ }
+
QmlScriptString scriptPropertyValue;
QmlScriptString scriptProperty() const {
return scriptPropertyValue;
@@ -424,6 +439,8 @@ public:
MyGroupedObject groupedValue;
MyGroupedObject *grouped() { return &groupedValue; }
+ MyGroupedObject *nullGrouped() { return 0; }
+
void doAction() { emit action(); }
signals:
void action();
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index c646583..c23bb2d 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -141,6 +141,7 @@ private:
QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \
QVERIFY(file.open(QIODevice::ReadOnly)); \
QByteArray data = file.readAll(); \
+ file.close(); \
QList<QByteArray> expected = data.split('\n'); \
expected.removeAll(QByteArray("")); \
QList<QmlError> errors = component.errors(); \
@@ -154,7 +155,16 @@ private:
} \
if (qgetenv("DEBUG") != "" && expected != actual) \
qWarning() << "Expected:" << expected << "Actual:" << actual; \
- QCOMPARE(expected, actual); \
+ if (qgetenv("QMLLANGUAGE_UPDATEERRORS") != "" && expected != actual) {\
+ QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \
+ QVERIFY(file.open(QIODevice::WriteOnly)); \
+ for (int ii = 0; ii < actual.count(); ++ii) { \
+ file.write(actual.at(ii)); file.write("\n"); \
+ } \
+ file.close(); \
+ } else { \
+ QCOMPARE(expected, actual); \
+ } \
}
inline QUrl TEST_FILE(const QString &filename)
@@ -214,6 +224,7 @@ void tst_qmllanguage::errors_data()
QTest::newRow("wrongType (color for size)") << "wrongType.12.qml" << "wrongType.12.errors.txt" << false;
QTest::newRow("wrongType (number string for int)") << "wrongType.13.qml" << "wrongType.13.errors.txt" << false;
QTest::newRow("wrongType (int for string)") << "wrongType.14.qml" << "wrongType.14.errors.txt" << false;
+ QTest::newRow("wrongType (int for url)") << "wrongType.15.qml" << "wrongType.15.errors.txt" << false;
QTest::newRow("readOnly.1") << "readOnly.1.qml" << "readOnly.1.errors.txt" << false;
QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false;
@@ -240,8 +251,14 @@ void tst_qmllanguage::errors_data()
QTest::newRow("missingSignal") << "missingSignal.qml" << "missingSignal.errors.txt" << false;
QTest::newRow("finalOverride") << "finalOverride.qml" << "finalOverride.errors.txt" << false;
QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false;
+
QTest::newRow("invalidGroupedProperty.1") << "invalidGroupedProperty.1.qml" << "invalidGroupedProperty.1.errors.txt" << false;
QTest::newRow("invalidGroupedProperty.2") << "invalidGroupedProperty.2.qml" << "invalidGroupedProperty.2.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.3") << "invalidGroupedProperty.3.qml" << "invalidGroupedProperty.3.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.4") << "invalidGroupedProperty.4.qml" << "invalidGroupedProperty.4.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.5") << "invalidGroupedProperty.5.qml" << "invalidGroupedProperty.5.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.6") << "invalidGroupedProperty.6.qml" << "invalidGroupedProperty.6.errors.txt" << false;
+ QTest::newRow("invalidGroupedProperty.7") << "invalidGroupedProperty.7.qml" << "invalidGroupedProperty.7.errors.txt" << true;
QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false;
QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false;
@@ -278,13 +295,28 @@ void tst_qmllanguage::errors_data()
QTest::newRow("Component.5") << "component.5.qml" << "component.5.errors.txt" << false;
QTest::newRow("Component.6") << "component.6.qml" << "component.6.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.3") << "invalidAttachedProperty.3.qml" << "invalidAttachedProperty.3.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.4") << "invalidAttachedProperty.4.qml" << "invalidAttachedProperty.4.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.5") << "invalidAttachedProperty.5.qml" << "invalidAttachedProperty.5.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.6") << "invalidAttachedProperty.6.qml" << "invalidAttachedProperty.6.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.7") << "invalidAttachedProperty.7.qml" << "invalidAttachedProperty.7.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.8") << "invalidAttachedProperty.8.qml" << "invalidAttachedProperty.8.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.9") << "invalidAttachedProperty.9.qml" << "invalidAttachedProperty.9.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.10") << "invalidAttachedProperty.10.qml" << "invalidAttachedProperty.10.errors.txt" << false;
+ QTest::newRow("invalidAttachedProperty.11") << "invalidAttachedProperty.11.qml" << "invalidAttachedProperty.11.errors.txt" << false;
+
QTest::newRow("nestedErrors") << "nestedErrors.qml" << "nestedErrors.errors.txt" << false;
QTest::newRow("defaultGrouped") << "defaultGrouped.qml" << "defaultGrouped.errors.txt" << false;
QTest::newRow("emptySignal") << "emptySignal.qml" << "emptySignal.errors.txt" << false;
QTest::newRow("doubleSignal") << "doubleSignal.qml" << "doubleSignal.errors.txt" << false;
QTest::newRow("invalidRoot") << "invalidRoot.qml" << "invalidRoot.errors.txt" << false;
+ QTest::newRow("missingValueTypeProperty") << "missingValueTypeProperty.qml" << "missingValueTypeProperty.errors.txt" << false;
+ QTest::newRow("objectValueTypeProperty") << "objectValueTypeProperty.qml" << "objectValueTypeProperty.errors.txt" << false;
}
+
void tst_qmllanguage::errors()
{
QFETCH(QString, file);
@@ -420,6 +452,7 @@ void tst_qmllanguage::assignBasicTypes()
QCOMPARE(object->boolProperty(), true);
QCOMPARE(object->variantProperty(), QVariant("Hello World!"));
QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2));
+ QCOMPARE(object->urlProperty(), component.url().resolved(QUrl("main.qml")));
QVERIFY(object->objectProperty() != 0);
MyTypeObject *child = qobject_cast<MyTypeObject *>(object->objectProperty());
QVERIFY(child != 0);
@@ -611,6 +644,7 @@ void tst_qmllanguage::attachedProperties()
QObject *attached = qmlAttachedPropertiesObject<MyQmlObject>(object);
QVERIFY(attached != 0);
QCOMPARE(attached->property("value"), QVariant(10));
+ QCOMPARE(attached->property("value2"), QVariant(13));
}
// Tests non-static object properties
diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
index 9c5dc30..cf54647 100644
--- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
+++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp
@@ -91,6 +91,9 @@ void tst_qmltimer::notRepeating()
QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true }"), QUrl("file://"));
QmlTimer *timer = qobject_cast<QmlTimer*>(component.create());
QVERIFY(timer != 0);
+ QVERIFY(timer->isRunning());
+ QVERIFY(!timer->isRepeating());
+ QCOMPARE(timer->interval(), 100);
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -107,6 +110,7 @@ void tst_qmltimer::notRepeatingStart()
QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100 }"), QUrl("file://"));
QmlTimer *timer = qobject_cast<QmlTimer*>(component.create());
QVERIFY(timer != 0);
+ QVERIFY(!timer->isRunning());
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
@@ -138,6 +142,11 @@ void tst_qmltimer::repeat()
QTest::qWait(TIMEOUT_TIMEOUT);
QVERIFY(helper.count > oldCount);
+
+ oldCount = helper.count;
+ timer->stop();
+ QTest::qWait(TIMEOUT_TIMEOUT);
+ QVERIFY(helper.count == oldCount);
}
void tst_qmltimer::triggeredOnStart()
@@ -146,6 +155,7 @@ void tst_qmltimer::triggeredOnStart()
QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl("file://"));
QmlTimer *timer = qobject_cast<QmlTimer*>(component.create());
QVERIFY(timer != 0);
+ QVERIFY(timer->triggeredOnStart());
TimerHelper helper;
connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout()));
diff --git a/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml b/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml
index 90ef1e5..efbb1b4 100644
--- a/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml
+++ b/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml
@@ -28,7 +28,7 @@ Rectangle {
transitions: [
Transition {
NumberAnimation {
- properties: "x"
+ matchProperties: "x"
}
}
]
diff --git a/tests/auto/declarative/visual/easing/easing.qml b/tests/auto/declarative/visual/easing/easing.qml
index f81400b..1e8e907 100644
--- a/tests/auto/declarative/visual/easing/easing.qml
+++ b/tests/auto/declarative/visual/easing/easing.qml
@@ -176,7 +176,7 @@ Rectangle {
to: "to"
reversible: true
NumberAnimation {
- properties: "x"
+ matchProperties: "x"
easing: type
duration: 1000
}