WeekNumberColumn.qml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (C) 2022 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // Qt-Security score:significant reason:default
  4. import QtQuick
  5. import QtQuick.Templates as T
  6. T.AbstractWeekNumberColumn {
  7. id: control
  8. implicitWidth: Math.max(background ? background.implicitWidth : 0,
  9. contentItem.implicitWidth + leftPadding + rightPadding)
  10. implicitHeight: Math.max(background ? background.implicitHeight : 0,
  11. contentItem.implicitHeight + topPadding + bottomPadding)
  12. spacing: 6
  13. leftPadding: 6
  14. rightPadding: 6
  15. font.bold: true
  16. //! [delegate]
  17. delegate: Text {
  18. text: weekNumber
  19. font: control.font
  20. horizontalAlignment: Text.AlignHCenter
  21. verticalAlignment: Text.AlignVCenter
  22. required property int weekNumber
  23. }
  24. //! [delegate]
  25. //! [contentItem]
  26. contentItem: Column {
  27. spacing: control.spacing
  28. Repeater {
  29. model: control.source
  30. delegate: control.delegate
  31. }
  32. }
  33. //! [contentItem]
  34. }