summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-02-01 03:23:16 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-02-01 03:23:16 (GMT)
commita6f90ca4d73365d37bdc4eaf8fe15cf55fe1bf83 (patch)
treed3fe9e480c35258a2be6b44dc4bac8417a3d536e /tests
parent7e85c6dc7ba0aaa6dfcad40dc0e9df0e2adb3741 (diff)
downloadQt-a6f90ca4d73365d37bdc4eaf8fe15cf55fe1bf83.zip
Qt-a6f90ca4d73365d37bdc4eaf8fe15cf55fe1bf83.tar.gz
Qt-a6f90ca4d73365d37bdc4eaf8fe15cf55fe1bf83.tar.bz2
Support animating attached properties.
Task-number: QTBUG-5580
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/animations/data/attached.qml34
-rw-r--r--tests/auto/declarative/animations/tst_animations.cpp12
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/auto/declarative/animations/data/attached.qml b/tests/auto/declarative/animations/data/attached.qml
new file mode 100644
index 0000000..0fb6f8c
--- /dev/null
+++ b/tests/auto/declarative/animations/data/attached.qml
@@ -0,0 +1,34 @@
+import Qt 4.6
+
+Rectangle {
+ width: 180; height: 200;
+
+ Component {
+ id: delegate
+ Rectangle {
+ id: wrapper
+ width: 180; height: 200
+ color: "blue"
+
+ states: State {
+ name: "otherState"
+ PropertyChanges { target: wrapper; color: "green" }
+ }
+
+ transitions: Transition {
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
+ ScriptAction { script: console.log(ListView.delayRemove ? "on" : "off") }
+ }
+
+ Component.onCompleted: {
+ console.log(ListView.delayRemove ? "on" : "off");
+ wrapper.state = "otherState"
+ }
+ }
+ }
+
+ ListView {
+ model: 1
+ delegate: delegate
+ }
+}
diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp
index 35eae73..7f043ba 100644
--- a/tests/auto/declarative/animations/tst_animations.cpp
+++ b/tests/auto/declarative/animations/tst_animations.cpp
@@ -67,6 +67,7 @@ private slots:
void propertiesTransition();
void easingStringConversion();
void invalidDuration();
+ void attached();
};
#define QTIMED_COMPARE(lhs, rhs) do { \
@@ -563,6 +564,17 @@ void tst_animations::invalidDuration()
QCOMPARE(pauseAnimation->duration(), 250);
}
+void tst_animations::attached()
+{
+ QmlEngine engine;
+
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/attached.qml"));
+ QTest::ignoreMessage(QtDebugMsg, "off");
+ QTest::ignoreMessage(QtDebugMsg, "on");
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+}
+
QTEST_MAIN(tst_animations)
#include "tst_animations.moc"