aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/snippets/data/calendarmodel/qtlabscalendar-calendarmodel.qml
blob: 3874ea44eb763e395fd00ad0ae6e822e338fdec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import QtQuick 2.0
import Qt.labs.calendar 1.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]