aboutsummaryrefslogtreecommitdiffstats
path: root/tests/baseline/controls/data/checkdelegate/checkdelegate.qml
blob: 7a50d2c31342f03e05b6b61b897e35aeed913d63 (plain)
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
96
97
98
99
100
101
import QtQuick
import QtQuick.Controls

import "../shared"

FlowPane {
    Repeater {
        model: ListModel {
            ListElement {
                text: qsTr("Option 1")
                down: true
                focus: false
                highlighted: false
                enabled: true
                checked: false
            }
            ListElement {
                text: qsTr("Option 2")
                down: false
                focus: true
                highlighted: false
                enabled: true
                checked: false
            }
            ListElement {
                text: qsTr("Option 3")
                down: false
                focus: false
                highlighted: true
                enabled: true
                checked: false
            }
            ListElement {
                text: qsTr("Option 4")
                down: false
                focus: false
                highlighted: false
                enabled: false
                checked: false
            }
            ListElement {
                text: qsTr("Option 5")
                down: false
                focus: false
                highlighted: false
                enabled: true
                checked: true
            }
            ListElement {
                text: qsTr("Option 6")
                down: false
                focus: false
                highlighted: false
                enabled: true
                checked: false
                tristate: false
                checkState: Qt.PartiallyChecked
            }
        }
        delegate: CheckDelegate {
            text: model.text
            down: model.down
            focus: model.focus
            highlighted: model.highlighted
            enabled: model.enabled
            checked: model.checked
        }
    }

    CheckDelegate {
        text: "Partially checked"
        tristate: true
        checkState: Qt.PartiallyChecked
    }

    CheckDelegate {
        text: "Style's icon color"
        icon.source: "../shared/heart.svg"
    }

    CheckDelegate {
        text: "Style's icon color (action)"
        action: Action {
            icon.source: "../shared/heart.svg"
        }
    }

    CheckDelegate {
        text: "Green icon color"
        icon.source: "../shared/heart.svg"
        icon.color: "green"
    }

    CheckDelegate {
        text: "Green icon color (action)"
        action: Action {
            icon.source: "../shared/heart.svg"
            icon.color: "green"
        }
    }
}