MonthGrid QML Type
달력 한 달의 날짜 표. 더 보기...
| Import Statement: | import QtQuick.Controls |
| Inherits: |
속성
신호
- clicked(date date)
- pressAndHold(date date)
- pressed(date date)
- released(date date)
상세 설명
MonthGrid는 달력을 그리드 형태로 표시합니다. 내용은 지정된 month 및 year 에 대해, 지정된 locale 를 사용하여 계산됩니다.

MonthGrid {
month: Calendar.December
year: 2015
locale: Qt.locale("en_US")
}MonthGrid는 독립형 컨트롤로 사용할 수 있지만, 대부분 DayOfWeekRow 및 WeekNumberColumn 와 함께 사용됩니다. 사용 사례에 관계없이 그리드의 배치 위치는 사용자가 결정합니다.

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
}
}custom delegate 을 구현하여 MonthGrid의 시각적 모양을 변경할 수 있습니다.
특정 월을 볼 때, MonthGrid는 이전 달과 다음 달의 날짜도 함께 표시합니다. 즉, 첫 번째 또는 마지막 행이 인접한 달에 완전히 속해 있더라도 항상 6개의 행을 표시합니다.
날짜 현지화
날짜를 지역화하려면 Locale.toString()를 사용하십시오. 예를 들어, 아랍어 로케일에서 일 번호를 표시하려면:
MonthGrid {
id: monthGrid
month: Calendar.December
year: 2015
locale: Qt.locale("ar")
delegate: Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: model.month === monthGrid.month ? 1 : 0
text: monthGrid.locale.toString(model.date, "d")
font: monthGrid.font
required property var model
}
}DayOfWeekRow, WeekNumberColumn, CalendarModel 및 Qt Quick Controls - Event Calendar도 참조하십시오 .
속성 설명서
delegate : Component
이 속성은 각 요일을 시각화하는 항목 델리게이트를 포함합니다.
index 속성 외에도, 각 델리게이트의 컨텍스트 내에서 다음과 같은 모델 데이터 역할 목록을 사용할 수 있습니다:
| model.date: 날짜 | 셀의 날짜 |
| model.day: int | 요일 번호 |
| model.today: bool | 델리게이트가 오늘을 나타내는지 여부 |
| model.weekNumber: int | 주 번호 |
| model.month: int | 월 번호 |
| model.year: int | 연도 번호 |
다음 코드 조각은 항목 델리게이트의 기본 구현을 보여줍니다. 이 코드는 사용자 정의 델리게이트를 구현할 때 출발점으로 사용할 수 있습니다.
MonthGrid 델리게이트에 대한 소유권을 가져가지 않습니다.
delegate: Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: model.month === control.month ? 1 : 0
text: model.day
font: control.font
color: control.palette.text
required property var model
}month : int
이 속성은 월 번호를 저장합니다. 기본값은 현재 월입니다.
이 문서의 Qt Quick Controls JavaScript Date 객체와 마찬가지로 0을 기준으로 한 월 번호를 사용합니다. 그러나 이는 월 번호가 1부터 시작되는 QDate 과는 다릅니다.
혼동을 피하기 위해 다음 열거형 값을 사용할 수 있습니다:
| 상수 | 설명 |
|---|---|
Calendar.January | 1월 (0) |
Calendar.February | 2월 (1) |
Calendar.March | 3월 (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) |
Calendar도 참조하십시오 .
title : string
이 속성은 달력의 제목을 저장합니다.
이 속성은 편의상 제공됩니다. ` MonthGrid ` 자체는 이 제목을 시각화하지 않습니다. 기본값은 ` locale`를 사용하여 서식이 지정된 월명과 연도 번호로 구성됩니다.
year : int
이 속성은 연도를 나타냅니다.
값은 -271820 에서 275759 사이의 범위여야 합니다. 기본값은 현재 연도입니다.
Signal 문서
clicked(date date)
date 를 클릭하면 이 신호가 발생합니다.
참고: 해당 핸들러는 onClicked 입니다.
pressAndHold(date date)
date 를 길게 누르면 이 신호가 발생합니다.
참고: 해당 핸들러는 onPressAndHold 입니다.
pressed(date date)
date 가 눌리면 이 신호가 발생합니다.
참고: 해당 핸들러는 onPressed 입니다.
released(date date)
이 신호는 date 가 해제될 때 발생합니다.
참고: 이에 해당하는핸들러는 onReleased 입니다.
© 2026 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.