diff options
Diffstat (limited to 'tests/auto/qml/qqmllocale')
-rw-r--r-- | tests/auto/qml/qqmllocale/data/localeAsCppProperty.qml | 6 | ||||
-rw-r--r-- | tests/auto/qml/qqmllocale/tst_qqmllocale.cpp | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmllocale/data/localeAsCppProperty.qml b/tests/auto/qml/qqmllocale/data/localeAsCppProperty.qml new file mode 100644 index 0000000000..ff80f3cf85 --- /dev/null +++ b/tests/auto/qml/qqmllocale/data/localeAsCppProperty.qml @@ -0,0 +1,6 @@ +import QtQml 2.2 +import Test 1.0 +Calendar { + locale: Qt.locale('en_GB') + property var testLocale +} diff --git a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp index eb6eb62648..cc13fb4b5f 100644 --- a/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp +++ b/tests/auto/qml/qqmllocale/tst_qqmllocale.cpp @@ -1214,10 +1214,9 @@ private: void tst_qqmllocale::localeAsCppProperty() { - QQmlComponent component(&engine); qmlRegisterType<Calendar>("Test", 1, 0, "Calendar"); - component.setData("import QtQml 2.2\nimport Test 1.0\nCalendar { locale: Qt.locale('en_GB'); property var testLocale }", QUrl()); - QVERIFY(!component.isError()); + QQmlComponent component(&engine, testFileUrl("localeAsCppProperty.qml")); + QVERIFY2(!component.isError(), qPrintable(component.errorString())); QTRY_VERIFY(component.isReady()); Calendar *item = qobject_cast<Calendar*>(component.create()); |