summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-05-29 14:57:07 +0200
committerMitch Curtis <mitch.curtis@qt.io>2017-06-16 12:15:29 +0000
commitd13e4db9d74aefc0bd08ca946b789155a11361fb (patch)
treebd99878b498975662042c51a0ee7b9fdaf9245c1 /tests
parent9f085b889524a80d4064d6ac01dbdc817bb31060 (diff)
downloadqtquickcontrols-d13e4db9d74aefc0bd08ca946b789155a11361fb.tar.gz
Calendar: make locale property public
This is useful to set a locale on a specific calendar, as opposed to using the application-wide default. plugins.qmltypes was also updated. [ChangeLog][Calendar] Added locale property, which affects which day is shown as the first day of the week, as well as date and day name localization. Task-number: QTBUG-60217 Change-Id: I113298a3f3b6dd407d26f3f55ed6973e73ab6a4c Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_calendar.qml18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/controls/data/tst_calendar.qml b/tests/auto/controls/data/tst_calendar.qml
index 1185aca9..814a361a 100644
--- a/tests/auto/controls/data/tst_calendar.qml
+++ b/tests/auto/controls/data/tst_calendar.qml
@@ -132,7 +132,7 @@ Item {
compare(calendar.selectedDate, new Date(new Date().setHours(0, 0, 0, 0)));
compare(calendar.frameVisible, true);
compare(calendar.dayOfWeekFormat, Locale.ShortFormat);
- compare(calendar.__locale, Qt.locale());
+ compare(calendar.locale, Qt.locale());
}
function test_setAfterConstructed() {
@@ -141,13 +141,13 @@ Item {
calendar.selectedDate = new Date(1980, 0, 1);
calendar.frameVisible = false;
calendar.dayOfWeekFormat = Locale.NarrowFormat;
- calendar.__locale = Qt.locale("de_DE");
+ calendar.locale = Qt.locale("de_DE");
compare(calendar.minimumDate, new Date(1900, 0, 1));
compare(calendar.maximumDate, new Date(1999, 11, 31));
compare(calendar.selectedDate, new Date(1980, 0, 1));
compare(calendar.frameVisible, false);
- compare(calendar.__locale, Qt.locale("de_DE"));
+ compare(calendar.locale, Qt.locale("de_DE"));
}
function test_selectedDate() {
@@ -205,7 +205,7 @@ Item {
calendar.selectedDate = new Date(2013, 0, 1);
// Set this to a certain locale, because days will be in different
// places depending on the system locale of the host machine.
- calendar.__locale = Qt.locale("en_GB");
+ calendar.locale = Qt.locale("en_GB");
/* January 2013 December 2012
M T W T F S S M T W T F S S
@@ -371,7 +371,7 @@ Item {
var startDate = new Date(2013, 0, 1);
calendar.selectedDate = startDate;
- calendar.__locale = Qt.locale("en_US");
+ calendar.locale = Qt.locale("en_US");
compare(calendar.selectedDate, startDate);
pressedSignalSpy.target = calendar;
@@ -457,7 +457,7 @@ Item {
calendar.minimumDate = new Date(2013, 0, 1);
calendar.selectedDate = new Date(startDate);
calendar.maximumDate = new Date(2013, 1, 5);
- calendar.__locale = Qt.locale("no_NO");
+ calendar.locale = Qt.locale("no_NO");
pressedSignalSpy.target = calendar;
pressedSignalSpy.signalName = "pressed";
@@ -531,7 +531,7 @@ Item {
22 23 24 25 26 27 28
29 30 31 1 2 3 4 */
- calendar.__locale = Qt.locale("en_GB");
+ calendar.locale = Qt.locale("en_GB");
calendar.selectedDate = new Date(2014, 11, 1);
mousePress(calendar, toPixelsX(0), toPixelsY(0), Qt.LeftButton);
compare(calendar.selectedDate, new Date(2014, 10, 24));
@@ -602,7 +602,7 @@ Item {
calendar.minimumDate = new Date(2014, 1, 1);
calendar.selectedDate = new Date(2014, 1, 28);
calendar.maximumDate = new Date(2014, 2, 31);
- calendar.__locale = Qt.locale("en_GB");
+ calendar.locale = Qt.locale("en_GB");
pressedSignalSpy.target = calendar;
pressedSignalSpy.signalName = "pressed";
@@ -875,7 +875,7 @@ Item {
function test_pressAndHold() {
calendar.selectedDate = new Date(2013, 0, 1);
- calendar.__locale = Qt.locale("en_GB");
+ calendar.locale = Qt.locale("en_GB");
pressedSignalSpy.target = calendar;
pressedSignalSpy.signalName = "pressed";