aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/basic/WeekNumberColumn.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/basic/WeekNumberColumn.qml')
-rw-r--r--src/quickcontrols/basic/WeekNumberColumn.qml40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/quickcontrols/basic/WeekNumberColumn.qml b/src/quickcontrols/basic/WeekNumberColumn.qml
new file mode 100644
index 0000000000..e5ce90bf3c
--- /dev/null
+++ b/src/quickcontrols/basic/WeekNumberColumn.qml
@@ -0,0 +1,40 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Templates as T
+
+T.AbstractWeekNumberColumn {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ spacing: 6
+ leftPadding: 6
+ rightPadding: 6
+ font.bold: true
+
+ //! [delegate]
+ delegate: Text {
+ text: weekNumber
+ font: control.font
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ required property int weekNumber
+ }
+ //! [delegate]
+
+ //! [contentItem]
+ contentItem: Column {
+ spacing: control.spacing
+ Repeater {
+ model: control.source
+ delegate: control.delegate
+ }
+ }
+ //! [contentItem]
+}