aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/HorizontalHeaderView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/material/HorizontalHeaderView.qml')
-rw-r--r--src/quickcontrols/material/HorizontalHeaderView.qml14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/quickcontrols/material/HorizontalHeaderView.qml b/src/quickcontrols/material/HorizontalHeaderView.qml
index 0a5fe4f9f5..76060d8e83 100644
--- a/src/quickcontrols/material/HorizontalHeaderView.qml
+++ b/src/quickcontrols/material/HorizontalHeaderView.qml
@@ -1,6 +1,8 @@
// Copyright (C) 2020 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
+pragma ComponentBehavior: Bound
+
import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls.Material
@@ -18,6 +20,10 @@ T.HorizontalHeaderView {
implicitHeight: Math.max(1, contentHeight)
delegate: Rectangle {
+ id: delegate
+
+ required property var model
+
// Qt6: add cellPadding (and font etc) as public API in headerview
readonly property real cellPadding: 8
@@ -27,11 +33,9 @@ T.HorizontalHeaderView {
Label {
id: text
- text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole]
- : model[control.textRole])
- : modelData
- width: parent.width
- height: parent.height
+ text: delegate.model[control.textRole]
+ width: delegate.width
+ height: delegate.height
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: enabled ? control.Material.foreground : control.Material.hintTextColor