diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-10-13 23:17:53 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-10-13 23:17:53 (GMT) |
commit | 3491cdb2c1c9184adfb0fab1e636afd784a6565e (patch) | |
tree | e2c83c35f66b4ef51535a5483c2954aa10c3b20e | |
parent | c8198d40af104b5555a975b3156e9d5ba1981e25 (diff) | |
download | Qt-3491cdb2c1c9184adfb0fab1e636afd784a6565e.zip Qt-3491cdb2c1c9184adfb0fab1e636afd784a6565e.tar.gz Qt-3491cdb2c1c9184adfb0fab1e636afd784a6565e.tar.bz2 |
fix test
(data now shadowed, Script changed)
-rw-r--r-- | tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp b/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp index c9c37ab..c1b31c2 100644 --- a/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp +++ b/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp @@ -3,6 +3,7 @@ #include <QtDeclarative/qmlcontext.h> #include <QtDeclarative/qbindablemap.h> #include <QtDeclarative/qmlcomponent.h> +#include <QtDeclarative/qfxtext.h> #include <QSignalSpy> class tst_QBindableMap : public QObject @@ -58,11 +59,13 @@ void tst_QBindableMap::changed() //make changes in QML QmlEngine engine; QmlContext *ctxt = engine.rootContext(); - ctxt->setContextProperty(QLatin1String("data"), &map); - QmlComponent component(&engine, "import Qt 4.6\nScript { script: \"data.key1 = 'Hello World';\" }", + ctxt->setContextProperty(QLatin1String("testdata"), &map); + QmlComponent component(&engine, "import Qt 4.6\nText { text: { testdata.key1 = 'Hello World'; 'X' } }", QUrl("file://")); QVERIFY(component.isReady()); - component.create(); + QFxText *txt = qobject_cast<QFxText*>(component.create()); + QVERIFY(txt); + QCOMPARE(txt->text(), QString('X')); QCOMPARE(spy.count(), 1); QList<QVariant> arguments = spy.takeFirst(); QCOMPARE(arguments.at(0).toString(),QLatin1String("key1")); |