File: WasmListView.qml

package info (click to toggle)
qt6-declarative 6.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 308,920 kB
  • sloc: cpp: 775,911; javascript: 514,247; xml: 10,855; python: 2,806; ansic: 2,253; java: 810; sh: 262; makefile: 41; php: 27
file content (95 lines) | stat: -rw-r--r-- 3,239 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Rectangle {
    id: listRect
    width: parent.width
    height: parent.height / 2
    color: "bisque"
    property alias listModel: wasmList.model

    ListView {
        id: wasmList
        anchors.fill: listRect
        clip: true
        Accessible.role: Accessible.List
        Accessible.name: "ListView"
        Accessible.description: "List view to add the names and emails of the invitees"
        headerPositioning: ListView.OverlayHeader
        focus: true
        header: Component {
            Row {
                z: 2
                spacing: 2
                Rectangle {
                    color: "#808080"
                    Text {
                        text: "Name"
                        width: listRect.width / 2
                        font.bold: true
                        horizontalAlignment: Text.AlignLeft
                        Layout.fillWidth: true
                        color: "black"
                        Accessible.role: Accessible.StaticText
                        Accessible.name: text
                        Accessible.description: "Invitee's name"
                    }
                    width: childrenRect.width
                    height: childrenRect.height
                }
                Rectangle {
                    color: "#808080"
                    Text {
                        text: "Email"
                        width: listRect.width / 2
                        color: 'black'
                        font.bold: true
                        horizontalAlignment: Text.AlignLeft
                        Layout.fillWidth: true
                        Accessible.role: Accessible.StaticText
                        Accessible.name: text
                        Accessible.description: "Invitee's email address"
                    }
                    width: childrenRect.width
                    height: childrenRect.height
                }
            }
        }
        delegate: Rectangle {
            width: wasmList.width
            height: 50
            color: index % 2 === 0 ? "#F5F5F5" : "#FFFFFF"

            Text {
                id: inviteeName
                anchors.left: parent.left
                anchors.verticalCenter: parent.verticalCenter
                leftPadding: 10
                width: listRect.width / 2
                text: model.name
                font.bold: true
                Accessible.role: Accessible.ListItem
                Accessible.name: text
                Accessible.description: text
                color: "black"
            }

            Text {
                id: inviteeEmail
                width: listRect.width / 2
                anchors.right: parent.right
                anchors.verticalCenter: parent.verticalCenter
                rightPadding: 10
                text: model.email
                font.bold: true
                color: "black"
                Accessible.role: Accessible.ListItem
                Accessible.name: text
                Accessible.description: text
            }
        }
    }
}