aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/snippets
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-09-23 20:01:40 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-09-25 16:30:47 +0000
commitd703de8752e07cb12e8ce2e2a05d608f2b26425a (patch)
tree828ef61dd89e13c9af7896e0e63a935ebd68c4ac /tests/auto/snippets
parente085574cd87c0faf99a79fee755a678347fcb540 (diff)
Initial QtQuick.Calendar docs
The overview is still missing. Change-Id: I081f1684b64fc8b95f59844b8373293523181266 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/snippets')
-rw-r--r--tests/auto/snippets/data/calendarmodel/qtquickcalendar2-calendarmodel.qml31
-rw-r--r--tests/auto/snippets/data/calendarview/qtquickcalendar2-calendarview-layout.qml34
-rw-r--r--tests/auto/snippets/data/calendarview/qtquickcalendar2-calendarview.qml10
-rw-r--r--tests/auto/snippets/data/dayofweekrow/qtquickcalendar2-dayofweekrow-layout.qml20
-rw-r--r--tests/auto/snippets/data/dayofweekrow/qtquickcalendar2-dayofweekrow.qml8
-rw-r--r--tests/auto/snippets/data/weeknumbercolumn/qtquickcalendar2-weeknumbercolumn-layout.qml22
-rw-r--r--tests/auto/snippets/data/weeknumbercolumn/qtquickcalendar2-weeknumbercolumn.qml10
7 files changed, 135 insertions, 0 deletions
diff --git a/tests/auto/snippets/data/calendarmodel/qtquickcalendar2-calendarmodel.qml b/tests/auto/snippets/data/calendarmodel/qtquickcalendar2-calendarmodel.qml
new file mode 100644
index 00000000..357e5ced
--- /dev/null
+++ b/tests/auto/snippets/data/calendarmodel/qtquickcalendar2-calendarmodel.qml
@@ -0,0 +1,31 @@
+import QtQuick 2.0
+import QtQuick.Calendar 2.0
+import QtQuick.Controls 2.0
+import QtQuick.Templates 2.0 as T
+
+//! [1]
+ListView {
+ id: listview
+
+ width: 200; height: 200
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ highlightRangeMode: ListView.StrictlyEnforceRange
+
+ model: CalendarModel {
+ from: new Date(2015, 0, 1)
+ to: new Date(2015, 11, 31)
+ }
+
+ delegate: CalendarView {
+ width: listview.width
+ height: listview.height
+
+ month: model.month
+ year: model.year
+ locale: Qt.locale("en_US")
+ }
+
+ T.ScrollIndicator.horizontal: ScrollIndicator { }
+}
+//! [1]
diff --git a/tests/auto/snippets/data/calendarview/qtquickcalendar2-calendarview-layout.qml b/tests/auto/snippets/data/calendarview/qtquickcalendar2-calendarview-layout.qml
new file mode 100644
index 00000000..8aba4e02
--- /dev/null
+++ b/tests/auto/snippets/data/calendarview/qtquickcalendar2-calendarview-layout.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.0
+import QtQuick.Layouts 1.0
+import QtQuick.Calendar 2.0
+
+//! [1]
+GridLayout {
+ columns: 2
+
+ DayOfWeekRow {
+ locale: view.locale
+
+ Layout.column: 1
+ Layout.fillWidth: true
+ }
+
+ WeekNumberColumn {
+ month: view.month
+ year: view.year
+ locale: view.locale
+
+ Layout.fillHeight: true
+ }
+
+ CalendarView {
+ id: view
+ month: 12
+ year: 2015
+ locale: Qt.locale("en_US")
+
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ }
+}
+//! [1]
diff --git a/tests/auto/snippets/data/calendarview/qtquickcalendar2-calendarview.qml b/tests/auto/snippets/data/calendarview/qtquickcalendar2-calendarview.qml
new file mode 100644
index 00000000..1795668f
--- /dev/null
+++ b/tests/auto/snippets/data/calendarview/qtquickcalendar2-calendarview.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+import QtQuick.Calendar 2.0
+
+//! [1]
+CalendarView {
+ month: 12
+ year: 2015
+ locale: Qt.locale("en_US")
+}
+//! [1]
diff --git a/tests/auto/snippets/data/dayofweekrow/qtquickcalendar2-dayofweekrow-layout.qml b/tests/auto/snippets/data/dayofweekrow/qtquickcalendar2-dayofweekrow-layout.qml
new file mode 100644
index 00000000..cb4fa2f3
--- /dev/null
+++ b/tests/auto/snippets/data/dayofweekrow/qtquickcalendar2-dayofweekrow-layout.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import QtQuick.Layouts 1.0
+import QtQuick.Calendar 2.0
+
+//! [1]
+ColumnLayout {
+ DayOfWeekRow {
+ locale: view.locale
+ Layout.fillWidth: true
+ }
+
+ CalendarView {
+ id: view
+ month: 12
+ year: 2015
+ locale: Qt.locale("en_US")
+ Layout.fillWidth: true
+ }
+}
+//! [1]
diff --git a/tests/auto/snippets/data/dayofweekrow/qtquickcalendar2-dayofweekrow.qml b/tests/auto/snippets/data/dayofweekrow/qtquickcalendar2-dayofweekrow.qml
new file mode 100644
index 00000000..e600e9c3
--- /dev/null
+++ b/tests/auto/snippets/data/dayofweekrow/qtquickcalendar2-dayofweekrow.qml
@@ -0,0 +1,8 @@
+import QtQuick 2.0
+import QtQuick.Calendar 2.0
+
+//! [1]
+DayOfWeekRow {
+ locale: Qt.locale("en_US")
+}
+//! [1]
diff --git a/tests/auto/snippets/data/weeknumbercolumn/qtquickcalendar2-weeknumbercolumn-layout.qml b/tests/auto/snippets/data/weeknumbercolumn/qtquickcalendar2-weeknumbercolumn-layout.qml
new file mode 100644
index 00000000..f954c2af
--- /dev/null
+++ b/tests/auto/snippets/data/weeknumbercolumn/qtquickcalendar2-weeknumbercolumn-layout.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QtQuick.Layouts 1.0
+import QtQuick.Calendar 2.0
+
+//! [1]
+RowLayout {
+ WeekNumberColumn {
+ month: 12
+ year: 2015
+ locale: view.locale
+ Layout.fillHeight: true
+ }
+
+ CalendarView {
+ id: view
+ month: 12
+ year: 2015
+ locale: Qt.locale("en_US")
+ Layout.fillHeight: true
+ }
+}
+//! [1]
diff --git a/tests/auto/snippets/data/weeknumbercolumn/qtquickcalendar2-weeknumbercolumn.qml b/tests/auto/snippets/data/weeknumbercolumn/qtquickcalendar2-weeknumbercolumn.qml
new file mode 100644
index 00000000..a36fe2a2
--- /dev/null
+++ b/tests/auto/snippets/data/weeknumbercolumn/qtquickcalendar2-weeknumbercolumn.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+import QtQuick.Calendar 2.0
+
+//! [1]
+WeekNumberColumn {
+ month: 12
+ year: 2015
+ locale: Qt.locale("en_US")
+}
+//! [1]