WeekNumberColumn QML Type
週番号の列。詳細...
| Import Statement: | import QtQuick.Controls |
| Inherits: |
プロパティ
詳細な説明
WeekNumberColumnは、列形式で週番号を表示します。週番号は、指定されたmonth およびyear に基づき、指定されたlocale を用いて計算されます。

WeekNumberColumn {
month: Calendar.December
year: 2015
locale: Qt.locale("en_US")
}WeekNumberColumnは単独のコントロールとして使用することもできますが、MonthGrid と組み合わせて使用されることが最も一般的です。使用方法にかかわらず、列の位置指定はユーザーに委ねられます。

RowLayout {
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.fillHeight: true
}
}custom delegate を実装することで、WeekNumberColumnの外観を変更できます。
「 MonthGrid 」および「DayOfWeekRow 」も参照してください 。
プロパティのドキュメント
delegate : Component
このプロパティには、各週番号を可視化するアイテムデリゲートが格納されます。
index プロパティに加え、各デリゲートのコンテキストでは、モデルデータのロールの一覧が利用可能です:
| model.weekNumber: int | 週番号 |
以下のスニペットは、アイテムデリゲートのデフォルトの実装を示しています。これは、カスタムデリゲートを実装する際の出発点として使用できます。
delegate: Text {
text: weekNumber
font: control.font
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
required property int weekNumber
}WeekNumberColumn デリゲートの所有権を取得しません。
month : int
このプロパティには、週番号の計算対象となる月の番号が格納されます。デフォルト値は現在の月です。
Qt Quick コントロール内のカレンダー関連の型は、JavaScriptのDateオブジェクトと同様に、0を起点とする月番号を使用します。ただし、これはQDate とは異なり、 では月の番号は1から始まります。
混乱を避けるために、以下の列挙値を使用できます。
| 定数 | 説明 |
|---|---|
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も参照してください 。
year : int
このプロパティには、週番号の計算対象となる年の番号が格納されます。
値は、-271820 から275759 の範囲内でなければなりません。デフォルト値は今年度です。
© 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.