CalendarModel QML Type
캘린더 모델입니다. 더 보기...
Import Statement: | import QtQuick.Controls |
속성
방법
- int indexOf(Date date)
- int indexOf(int year, int month)
- int monthAt(int index)
- int yearAt(int index)
상세 설명
CalendarModel은 다양한 MonthGrid 인스턴스를 생성하는 방법을 제공합니다. 일반적으로 MonthGrid 을 델리게이트로 사용하는 ListView 의 모델로 사용됩니다.
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: MonthGrid { width: listview.width height: listview.height month: model.month year: model.year locale: Qt.locale("en_US") } ScrollIndicator.horizontal: ScrollIndicator { } }
index
속성 외에도 각 델리게이트의 컨텍스트에서 모델 데이터 역할 목록을 사용할 수 있습니다:
model.month: int | 월의 숫자 |
model.year: int | 연도 번호 |
Qt Quick 캘린더 모듈은 0을 기준으로 한 월 번호를 사용하여 QML 언어에서 사용하는 JavaScript 날짜 유형과 일관성을 유지합니다. 즉, Date::getMonth()
을 그대로 메서드에 전달할 수 있습니다. 월 번호를 직접 처리할 때는 혼동을 피하기 위해 다음 열거형 값을 사용하는 것이 좋습니다.
상수 | 설명 |
---|---|
Calendar.January | January (0) |
Calendar.February | February (1) |
Calendar.March | March (2) |
Calendar.April | 4월 (3) |
Calendar.May | 5월 (4) |
Calendar.June | 6월 (5) |
Calendar.July | 7월 (6) |
Calendar.August | 8월 (7) |
Calendar.September | 9월 (8) |
Calendar.October | 10월 (9) |
Calendar.November | 11월 (10) |
Calendar.December | 12월 (11) |
속성 문서
from : date |
이 속성은 시작 날짜를 보유합니다.
to : date |
이 속성은 종료 날짜를 보유합니다.
메서드 문서
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.