summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmllistmodel
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-29 23:53:03 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-29 23:53:03 (GMT)
commit1f8e66b71bc641a9e29f3b3157de2d393d911f23 (patch)
tree21c0f0063455abdb44e2b0ec529eca57e795d00f /tests/auto/declarative/qmllistmodel
parenta432859f0494b127495932b7365b62a4e579dc2e (diff)
downloadQt-1f8e66b71bc641a9e29f3b3157de2d393d911f23.zip
Qt-1f8e66b71bc641a9e29f3b3157de2d393d911f23.tar.gz
Qt-1f8e66b71bc641a9e29f3b3157de2d393d911f23.tar.bz2
Fix and test ListModel UTF8 reading.
Diffstat (limited to 'tests/auto/declarative/qmllistmodel')
-rw-r--r--tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp b/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp
index f2ffb7b..c7de5d9 100644
--- a/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp
+++ b/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp
@@ -51,12 +51,26 @@ public:
tst_QmlListModel() {}
private slots:
+ void static_i18n();
void dynamic_data();
void dynamic();
void error_data();
void error();
};
+void tst_QmlListModel::static_i18n()
+{
+ QString expect = QString::fromUtf8("na\303\257ve");
+ QString componentStr = "import Qt 4.6\nListModel { ListElement { prop1: \""+expect+"\" } }";
+ QmlEngine engine;
+ QmlComponent component(&engine, componentStr.toUtf8(), QUrl("file://"));
+ QmlListModel *obj = qobject_cast<QmlListModel*>(component.create());
+ QVERIFY(obj != 0);
+ QString prop = obj->get(0).property(QLatin1String("prop1")).toString();
+ QCOMPARE(prop,expect);
+ delete obj;
+}
+
void tst_QmlListModel::dynamic_data()
{
QTest::addColumn<QString>("script");