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 Controls 의 달력 관련 타입은 JavaScript Date 객체처럼 0을 기준으로 한 월 번호를 사용합니다. 그러나 이는 월이 1부터 번호가 매겨지는 QDate 와는 다릅니다.
혼동을 피하기 위해 다음 열거형 값을 사용할 수 있습니다:
| 상수 | 설명 |
|---|---|
Calendar.January | 1월 (0) |
Calendar.February | 2월 (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.