diff options
| author | MohammadHossein Qanbari <mohammad.qanbari@qt.io> | 2024-12-06 12:15:40 +0100 |
|---|---|---|
| committer | MohammadHossein Qanbari <mohammad.qanbari@qt.io> | 2025-03-06 03:08:26 +0100 |
| commit | 9601b74dabed53e93a7a5144d4c1fadb7876db18 (patch) | |
| tree | 0b5f05771108c78c91e644e80d02601ec8b8c672 /src/quickcontrols/basic/VerticalHeaderView.qml | |
| parent | 79947ea6d5c104f3253f6fbd7ef7244c4015acac (diff) | |
QuickControls: Add vertical and horizontal header view delegates
Implement QQuickHeaderViewDelegate as the base class for header view
delegates, introducing 'headerView' and 'orientation' properties.
Separate previous delegate settings into HorizontalHeaderViewDelegate
and VerticalHeaderViewDelegate components for Basic, Fusion, and Imagine
styles.
This change improves the modularity and reusability of header view
delegates across different styles. It also allows for more consistent
behavior and easier customization of header views.
A test suite has been added to verify default property settings and
ensure the new components work without warnings.
[ChangeLog][QtQuickControls][HeaderView] Add dedicated delegate
components for vertical and horizontal header views.
Task-number: QTBUG-70326
Change-Id: I8831e77f6909bdae13c3a7262145ab156f63a59a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quickcontrols/basic/VerticalHeaderView.qml')
| -rw-r--r-- | src/quickcontrols/basic/VerticalHeaderView.qml | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/quickcontrols/basic/VerticalHeaderView.qml b/src/quickcontrols/basic/VerticalHeaderView.qml index 52a9bcb876..ecc8e0a653 100644 --- a/src/quickcontrols/basic/VerticalHeaderView.qml +++ b/src/quickcontrols/basic/VerticalHeaderView.qml @@ -3,7 +3,6 @@ pragma ComponentBehavior: Bound -import QtQuick import QtQuick.Templates as T T.VerticalHeaderView { @@ -17,27 +16,5 @@ T.VerticalHeaderView { implicitWidth: Math.max(1, contentWidth) implicitHeight: syncView ? syncView.height : 0 - delegate: Rectangle { - id: delegate - - required property var model - - // Qt6: add cellPadding (and font etc) as public API in headerview - readonly property real cellPadding: 8 - - implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2)) - implicitHeight: text.implicitHeight + (cellPadding * 2) - color: "#f6f6f6" - border.color: "#e4e4e4" - - Label { - id: text - text: delegate.model[control.textRole] - width: delegate.width - height: delegate.height - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - color: "#ff26282a" - } - } + delegate: VerticalHeaderViewDelegate { } } |
