summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml
blob: 83988abb888e2aaca0f95b9112eaff5cabda0c81 (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
import Qt 4.6

//! [grab property]
Item {
    id: contactDetails
    width: 230
    height: layout.height
    property var mouseGrabbed: false
//! [grab property]

    property var contactId: ""
    property var label: ""
    property var phone: ""
    property var email: ""

    onLabelChanged: { labelField.value = label }
    onEmailChanged: { emailField.value = email }
    onPhoneChanged: { phoneField.value = phone }

    Column {
        id: layout
        anchors.fill: parent
        spacing: 5
        margin: 5
        ContactField {
            id: labelField
            anchors.left: layout.left
            anchors.leftMargin: 5
            anchors.right: layout.right
            anchors.rightMargin: 5
            label: "Name"
        }
        ContactField {
            id: phoneField
            anchors.left: layout.left
            anchors.leftMargin: 5
            anchors.right: layout.right
            anchors.rightMargin: 5
            icon: "../../shared/pics/phone.png"
            label: "Phone"
        }
        ContactField {
            id: emailField
            anchors.left: layout.left
            anchors.leftMargin: 5
            anchors.right: layout.right
            anchors.rightMargin: 5
            icon: "../../shared/pics/email.png"
            label: "Email"
        }
    }
}