aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/universal/HorizontalHeaderView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/universal/HorizontalHeaderView.qml')
-rw-r--r--src/quickcontrols/universal/HorizontalHeaderView.qml14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/quickcontrols/universal/HorizontalHeaderView.qml b/src/quickcontrols/universal/HorizontalHeaderView.qml
index c72af49c57..f792a1e690 100644
--- a/src/quickcontrols/universal/HorizontalHeaderView.qml
+++ b/src/quickcontrols/universal/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.Controls.impl
import QtQuick.Templates as T
@@ -19,6 +21,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
@@ -28,11 +34,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: Color.transparent(control.Universal.foreground, enabled ? 1.0 : 0.2)