diff options
Diffstat (limited to 'src/quickcontrols/ios/HorizontalHeaderView.qml')
-rw-r--r-- | src/quickcontrols/ios/HorizontalHeaderView.qml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/quickcontrols/ios/HorizontalHeaderView.qml b/src/quickcontrols/ios/HorizontalHeaderView.qml index b6abd9e1d9..1a02ff8f05 100644 --- a/src/quickcontrols/ios/HorizontalHeaderView.qml +++ b/src/quickcontrols/ios/HorizontalHeaderView.qml @@ -1,6 +1,8 @@ // Copyright (C) 2023 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 + readonly property real cellPadding: 8 implicitWidth: text.implicitWidth + (cellPadding * 2) @@ -24,11 +30,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 } |