diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-06-22 02:23:25 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-06-22 02:23:25 (GMT) |
commit | 84a4a2ed1b17dd8d73404f52af032b959aada8b1 (patch) | |
tree | 82567474b3db63f194fb6c4d09bacbb186fa8766 /tests/auto/declarative/qdeclarativelistmodel | |
parent | 02c83c2adf0513041d9a3866d4e589ad79d61bda (diff) | |
download | Qt-84a4a2ed1b17dd8d73404f52af032b959aada8b1.zip Qt-84a4a2ed1b17dd8d73404f52af032b959aada8b1.tar.gz Qt-84a4a2ed1b17dd8d73404f52af032b959aada8b1.tar.bz2 |
Allow QT_TR_NOOP (as a no-op) in ListModel values.
Task-number: QTBUG-11403
Diffstat (limited to 'tests/auto/declarative/qdeclarativelistmodel')
-rw-r--r-- | tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index b3b6c20..3d66733 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -48,6 +48,7 @@ #include <QtCore/qtimer.h> #include <QtCore/qdebug.h> +#include <QtCore/qtranslator.h> #include "../../../shared/util.h" @@ -124,14 +125,17 @@ void tst_qdeclarativelistmodel::waitForWorker(QDeclarativeItem *item) void tst_qdeclarativelistmodel::static_i18n() { QString expect = QString::fromUtf8("na\303\257ve"); - QString componentStr = "import Qt 4.7\nListModel { ListElement { prop1: \""+expect+"\" } }"; + + QString componentStr = "import Qt 4.7\nListModel { ListElement { prop1: \""+expect+"\"; prop2: QT_TR_NOOP(\""+expect+"\") } }"; QDeclarativeEngine engine; QDeclarativeComponent component(&engine); component.setData(componentStr.toUtf8(), QUrl::fromLocalFile("")); QDeclarativeListModel *obj = qobject_cast<QDeclarativeListModel*>(component.create()); QVERIFY(obj != 0); - QString prop = obj->get(0).property(QLatin1String("prop1")).toString(); - QCOMPARE(prop,expect); + QString prop1 = obj->get(0).property(QLatin1String("prop1")).toString(); + QCOMPARE(prop1,expect); + QString prop2 = obj->get(0).property(QLatin1String("prop2")).toString(); + QCOMPARE(prop2,expect); // (no, not translated, QT_TR_NOOP is a no-op) delete obj; } |