diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-10-15 09:05:43 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-10-15 09:11:31 (GMT) |
commit | 3ef69b12f6d6905594ef3976b3e16787378dfe6a (patch) | |
tree | 1105fb45cddf0afca5929041e679e743e36a1772 /tests/auto/declarative/qdeclarativeecmascript | |
parent | 1745a0e7799774373ad6252a73d6e8af841db2a1 (diff) | |
parent | 9358d77fc1de64d2a8a06bfa4095dcde9f9b009b (diff) | |
download | Qt-3ef69b12f6d6905594ef3976b3e16787378dfe6a.zip Qt-3ef69b12f6d6905594ef3976b3e16787378dfe6a.tar.gz Qt-3ef69b12f6d6905594ef3976b3e16787378dfe6a.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
src/gui/painting/qpaintengine_raster.cpp
tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml | 8 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 19 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml new file mode 100644 index 0000000..ca8c90d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 + +QtObject { + objectName: "hello" + + property string test1: objectName + property string test2: objectName.substr(1, 3) +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 4feb630..02832f3 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -162,6 +162,7 @@ private slots: void deleteLater(); void in(); void sharedAttachedObject(); + void objectName(); void include(); @@ -2594,6 +2595,24 @@ void tst_qdeclarativeecmascript::sharedAttachedObject() delete o; } +// QTBUG-13999 +void tst_qdeclarativeecmascript::objectName() +{ + QDeclarativeComponent component(&engine, TEST_FILE("objectName.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toString(), QString("hello")); + QCOMPARE(o->property("test2").toString(), QString("ell")); + + o->setObjectName("world"); + + QCOMPARE(o->property("test1").toString(), QString("world")); + QCOMPARE(o->property("test2").toString(), QString("orl")); + + delete o; +} + QTEST_MAIN(tst_qdeclarativeecmascript) #include "tst_qdeclarativeecmascript.moc" |