qt controls2不再提供Calendar控件,而是在import Qt.labs.calendar 1.0提供
A calendar namespace | |
A calendar model | |
A row of names for the days in a week | |
A grid of days for a calendar month | |
A column of week numbers |
这样相对于qt controls实现一个Calendar要麻烦些,但灵活度提高了很多
简单实现
GridLayout {
columns: 2
DayOfWeekRow {
locale: grid.locale
Layout.column: 1
Layout.fillWidth: true
}
WeekNumberColumn {
month: grid.month
year: grid.year
locale: grid.locale
Layout.fillHeight: true
}
MonthGrid {
id: grid
month: Calendar.December
year: 2015
locale: Qt.locale("en_US")
Layout.fillWidth: true
Layout.fillHeight: true
}
}