diff options
Diffstat (limited to 'src/quickcontrols/imagine/HorizontalHeaderView.qml')
-rw-r--r-- | src/quickcontrols/imagine/HorizontalHeaderView.qml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/quickcontrols/imagine/HorizontalHeaderView.qml b/src/quickcontrols/imagine/HorizontalHeaderView.qml index bbc8064a23..9f571a8f62 100644 --- a/src/quickcontrols/imagine/HorizontalHeaderView.qml +++ b/src/quickcontrols/imagine/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 @@ -16,6 +18,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 @@ -26,11 +32,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: "#ff26282a" |