summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qmldom/tst_qmldom.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmldom/tst_qmldom.cpp b/tests/auto/declarative/qmldom/tst_qmldom.cpp
index 390e79a..91fe7a6 100644
--- a/tests/auto/declarative/qmldom/tst_qmldom.cpp
+++ b/tests/auto/declarative/qmldom/tst_qmldom.cpp
@@ -16,6 +16,8 @@ private slots:
void loadProperties();
void loadChildObject();
+ void testValueSource();
+
private:
QmlEngine engine;
};
@@ -85,6 +87,23 @@ void tst_qmldom::loadChildObject()
QVERIFY(childItem.objectType() == "Item");
}
+void tst_qmldom::testValueSource()
+{
+ QByteArray qml = "Rect { height: Follow { spring: 1.4; damping: .15; source: Math.min(Math.max(-130, value*2.2 - 130), 133); }}";
+
+ QmlEngine freshEngine;
+ QmlDomDocument document;
+ QVERIFY(document.load(&freshEngine, qml));
+
+ QmlDomObject rootItem = document.rootObject();
+ QVERIFY(rootItem.isValid());
+ QmlDomProperty heightProperty = rootItem.properties().at(0);
+ QVERIFY(heightProperty.propertyName() == "height");
+ QVERIFY(heightProperty.value().isValueSource());
+ const QmlDomValueValueSource valueSource = heightProperty.value().toValueSource();
+ QVERIFY(valueSource.object().isValid());
+}
+
QTEST_MAIN(tst_qmldom)
#include "tst_qmldom.moc"