summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-07 07:26:56 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-07 07:26:56 (GMT)
commit50576620bc00151674f58c7712cc38a5b97b74c7 (patch)
tree84d96cd69e6ab091b1451b54f653db49c8a17d8a /demos
parent3f9534dc96eaa2154efe759215466cdbd247664c (diff)
parent2d76308b923717e613a499894440185fa618b5e7 (diff)
downloadQt-50576620bc00151674f58c7712cc38a5b97b74c7.zip
Qt-50576620bc00151674f58c7712cc38a5b97b74c7.tar.gz
Qt-50576620bc00151674f58c7712cc38a5b97b74c7.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'demos')
-rw-r--r--demos/declarative/contacts/Contact.qml5
-rw-r--r--demos/declarative/contacts/ContactField.qml2
-rw-r--r--demos/declarative/contacts/contacts.qml21
3 files changed, 20 insertions, 8 deletions
diff --git a/demos/declarative/contacts/Contact.qml b/demos/declarative/contacts/Contact.qml
index 342c356..7297fa6 100644
--- a/demos/declarative/contacts/Contact.qml
+++ b/demos/declarative/contacts/Contact.qml
@@ -52,6 +52,11 @@ Item {
}
]
+ function refresh() {
+ labelField.value = label;
+ emailField.value = email;
+ phoneField.value = phone;
+ }
function update() {
updateContactQuery.exec();
}
diff --git a/demos/declarative/contacts/ContactField.qml b/demos/declarative/contacts/ContactField.qml
index 3ce2c1a..cb319ae 100644
--- a/demos/declarative/contacts/ContactField.qml
+++ b/demos/declarative/contacts/ContactField.qml
@@ -5,7 +5,7 @@ Item {
property var label: "Name"
property var icon: "pics/phone.png"
property var value: ""
- onValueChanged: { fieldText.text=field.value }
+ onValueChanged: { fieldText.text = contactField.value }
RemoveButton {
id: removeButton
anchors.right: parent.right
diff --git a/demos/declarative/contacts/contacts.qml b/demos/declarative/contacts/contacts.qml
index ce5a2b5..4582bd1 100644
--- a/demos/declarative/contacts/contacts.qml
+++ b/demos/declarative/contacts/contacts.qml
@@ -39,9 +39,11 @@ Rect {
children: [
MouseRegion {
anchors.fill: parent
- onClicked: { Details.qml = 'Contact.qml';
+ onClicked: {
+ Details.qml = 'Contact.qml';
wrapper.state='opened';
- contacts.mode = 'edit'; }
+ contacts.mode = 'edit';
+ }
}
]
}
@@ -142,7 +144,7 @@ Rect {
anchors.right: parent.right
anchors.rightMargin: 5
icon: "pics/new.png"
- onClicked: { print("open new contact edit"); newContactItem.label = ''; newContactItem.phone = ''; newContactItem.email = ''; contacts.mode = 'new' }
+ onClicked: { newContactItem.refresh(); contacts.mode = 'new' }
opacity: contacts.mode == 'list' ? 1 : 0
}
Button {
@@ -174,10 +176,15 @@ Rect {
delegate: contactDelegate
focus: false
}
- Contact {
- id: newContactItem
+ FocusRealm {
+ id: newContactWrapper
anchors.fill: contactListView
opacity: 0
+ focus: contacts.mode == 'new'
+ Contact {
+ id: newContactItem
+ anchors.fill: parent
+ }
}
Connection {
sender: confirmEditButton
@@ -234,7 +241,7 @@ Rect {
]
}
KeyProxy {
- focus: true
+ focus: contacts.mode != 'new'
targets: { contacts.mode == "list" ? [searchBarWrapper, contactListView] : [contactListView]}
}
states: [
@@ -247,7 +254,7 @@ Rect {
value: 0
}
SetProperty {
- target: newContactItem
+ target: newContactWrapper
property: "opacity"
value: 1
}