Kirigami-addons

TableCellDelegate.qml
1/*
2 * Copyright 2023 Evgeny Chesnokov <echesnokov@astralinux.ru>
3 * SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5
6import QtQuick
7import QtQuick.Controls as QQC2
8
9import org.kde.kirigami as Kirigami
10
11QQC2.ItemDelegate {
12 id: delegate
13
14 Accessible.role: Accessible.Cell
15 highlighted: selected
16
17 required property int row
18 required property var index
19 required property int column
20 required property bool current
21 required property bool selected
22 required property var model
23
24 readonly property AbstractHeaderComponent headerComponent: __columnModel.get(column).headerComponent
25
26 Rectangle {
27 anchors.fill: parent
28 visible: delegate.current
29 color: "Transparent"
30 border.color: Kirigami.Theme.highlightColor
31 }
32
33 contentItem: Loader {
34 sourceComponent: delegate.headerComponent.itemDelegate
35 readonly property var modelData: model.display ?? delegate.model[delegate.headerComponent.textRole]
36 readonly property var index: delegate.index
37 readonly property int row: delegate.row
38 readonly property int column: delegate.column
39 readonly property var model: delegate.model
40 }
41
42 onClicked: delegate.forceActiveFocus()
43}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:05:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.