diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-12-20 11:02:10 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-20 06:37:53 +0100 |
commit | f0c82e77aa2811c326c543468fc422c18ca98a47 (patch) | |
tree | d8fb0d1338fe7d4c741c506cd6c3f42314d9896a /tests/auto/declarative/qdeclarativelocale/tst_qdeclarativelocale.cpp | |
parent | 2ac33932be979452e1d4fa3ec4e6b6a301e5f6e4 (diff) |
Qt.locale() always returns the 'C' locale.
QLocale(QString()) does not return the default locale. If no
locale is specified, use the QLocale() constructor.
Change-Id: I76198b7ea66a6326483ec47ac36e080159ca459a
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativelocale/tst_qdeclarativelocale.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativelocale/tst_qdeclarativelocale.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelocale/tst_qdeclarativelocale.cpp b/tests/auto/declarative/qdeclarativelocale/tst_qdeclarativelocale.cpp index b2f35fd8b3..d49122c889 100644 --- a/tests/auto/declarative/qdeclarativelocale/tst_qdeclarativelocale.cpp +++ b/tests/auto/declarative/qdeclarativelocale/tst_qdeclarativelocale.cpp @@ -54,6 +54,8 @@ public: tst_qdeclarativelocale() { } private slots: + void defaultLocale(); + void properties_data(); void properties(); void currencySymbol_data(); @@ -114,6 +116,16 @@ private: QDeclarativeEngine engine; }; +void tst_qdeclarativelocale::defaultLocale() +{ + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("properties.qml"))); + + QObject *obj = c.create(); + QVERIFY(obj); + + QCOMPARE(obj->property("name").toString(), QLocale().name()); +} + #define LOCALE_PROP(type,prop) { #prop, QVariant(type(qlocale.prop())) } void tst_qdeclarativelocale::addPropertyData(const QString &l) |