aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmltranslation
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmltranslation')
-rw-r--r--tests/auto/qml/qqmltranslation/data/translationChange.qml8
-rw-r--r--tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp2
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmltranslation/data/translationChange.qml b/tests/auto/qml/qqmltranslation/data/translationChange.qml
index c48a482138..ae3231935c 100644
--- a/tests/auto/qml/qqmltranslation/data/translationChange.qml
+++ b/tests/auto/qml/qqmltranslation/data/translationChange.qml
@@ -3,6 +3,13 @@ import QtQuick 2.0
TranslationChangeBase {
id: root
+ ListModel {
+ id: listModel
+ ListElement {
+ text: qsTr("translate me")
+ }
+ }
+
baseProperty: "do not translate"
property string text1: qsTr("translate me")
function weDoTranslations() {
@@ -10,6 +17,7 @@ TranslationChangeBase {
}
property string text2: weDoTranslations()
property string text3
+ property string fromListModel: listModel.get(0).text
states: [
State {
diff --git a/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp b/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
index 733fe77346..5042a236d4 100644
--- a/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
+++ b/tests/auto/qml/qqmltranslation/tst_qqmltranslation.cpp
@@ -195,6 +195,7 @@ void tst_qqmltranslation::translationChange()
QCOMPARE(object->property("text1").toString(), QString::fromUtf8("translate me"));
QCOMPARE(object->property("text2").toString(), QString::fromUtf8("translate me"));
QCOMPARE(object->property("text3").toString(), QString::fromUtf8("translate me"));
+ QCOMPARE(object->property("fromListModel").toString(), QString::fromUtf8("translate me"));
DummyTranslator translator;
QCoreApplication::installTranslator(&translator);
@@ -206,6 +207,7 @@ void tst_qqmltranslation::translationChange()
QCOMPARE(object->property("text1").toString(), QString::fromUtf8("xxx"));
QCOMPARE(object->property("text2").toString(), QString::fromUtf8("xxx"));
QCOMPARE(object->property("text3").toString(), QString::fromUtf8("xxx"));
+ QCOMPARE(object->property("fromListModel").toString(), QString::fromUtf8("xxx"));
QCoreApplication::removeTranslator(&translator);
}