VerticalHeaderViewDelegate.qml 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2025 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.Controls.Material
  6. import QtQuick.Templates as T
  7. T.HeaderViewDelegate {
  8. id: control
  9. // same as AbstractButton.qml
  10. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  11. implicitContentWidth + leftPadding + rightPadding)
  12. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  13. implicitContentHeight + topPadding + bottomPadding)
  14. padding: 8
  15. highlighted: selected
  16. background: Rectangle {
  17. color: control.Material.backgroundColor
  18. }
  19. contentItem: Label {
  20. horizontalAlignment: Text.AlignHCenter
  21. verticalAlignment: Text.AlignVCenter
  22. color: enabled ? control.Material.foreground
  23. : control.Material.hintTextColor
  24. text: control.model[control.headerView.textRole]
  25. }
  26. }