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.Templates as T
  6. T.HeaderViewDelegate {
  7. id: control
  8. // same as AbstractButton.qml
  9. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  10. implicitContentWidth + leftPadding + rightPadding)
  11. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  12. implicitContentHeight + topPadding + bottomPadding)
  13. padding: 8
  14. highlighted: selected
  15. background: Rectangle {
  16. border.color: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ?
  17. control.palette.windowText : control.palette.midlight
  18. color: control.palette.light
  19. }
  20. contentItem: Label {
  21. horizontalAlignment: Text.AlignHCenter
  22. verticalAlignment: Text.AlignVCenter
  23. color: control.palette.windowText
  24. text: control.model[control.headerView.textRole]
  25. }
  26. }