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 Calendarモジュールは、QML言語で使用されるJavaScriptのDate型と整合性を取るために、0ベースの月番号を使用します。つまり、Date::getMonth()
をそのままメソッドに渡すことができます。月番号を直接扱う場合は、混乱を避けるために以下の列挙値を使うことを強く推奨します。
定数 | 説明 |
---|---|
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) |
MonthGrid およびCalendarもご参照 ください。
プロパティ文書
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.