summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-06-22 02:23:25 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-06-22 02:23:25 (GMT)
commit84a4a2ed1b17dd8d73404f52af032b959aada8b1 (patch)
tree82567474b3db63f194fb6c4d09bacbb186fa8766 /tests
parent02c83c2adf0513041d9a3866d4e589ad79d61bda (diff)
downloadQt-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')
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp10
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;
}