summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorIan Walters <ian.walters@nokia.com>2009-04-24 05:08:03 (GMT)
committerIan Walters <ian.walters@nokia.com>2009-04-24 05:08:03 (GMT)
commit4eee67a60a173ba16ee3154377da7f410cabe168 (patch)
tree2c5ba9eefb3cfca458a5585b0c2eba432f4a2289 /examples
parent0af965285378ae51ac98dfade94f216761449459 (diff)
downloadQt-4eee67a60a173ba16ee3154377da7f410cabe168.zip
Qt-4eee67a60a173ba16ee3154377da7f410cabe168.tar.gz
Qt-4eee67a60a173ba16ee3154377da7f410cabe168.tar.bz2
Further tutorial work. Draft of second chapter.
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml3
-rw-r--r--examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml3
-rw-r--r--examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml2
-rw-r--r--examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml10
-rw-r--r--examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml6
-rw-r--r--examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml6
-rw-r--r--examples/declarative/tutorials/contacts/3_Collections/FieldText.qml2
-rw-r--r--examples/declarative/tutorials/contacts/Final/FieldText.qml2
8 files changed, 17 insertions, 17 deletions
diff --git a/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml b/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml
index 13bc209..92afc0c 100644
--- a/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml
+++ b/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml
@@ -1,7 +1,4 @@
<Rect id="page" width="{layout.width}" height="{layout.height}" color='white'>
- <properties>
- <Property name="mouseGrabbed" value="false"/>
- </properties>
<VerticalLayout id="layout" width="{contents.width}" margin="5" spacing="5">
<GroupBox contents="ContactField1.qml" label="Loading Component"/>
<GroupBox contents="ContactField2.qml" label="Using properties"/>
diff --git a/examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml b/examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml
index 9e988c0..e87ed60 100644
--- a/examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml
+++ b/examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml
@@ -2,6 +2,9 @@
width="230"
height="{layout.height}">
<properties>
+ <Property name="mouseGrabbed" value="false"/>
+ </properties>
+ <properties>
<Property name="contactid" value=""/>
<Property name="label" onValueChanged="labelField.value = label"/>
<Property name="phone" onValueChanged="phoneField.value = phone"/>
diff --git a/examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml b/examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml
index 97c0772..d09ad0b 100644
--- a/examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml
+++ b/examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml
@@ -58,7 +58,7 @@
color="#505050"
font.italic="true"
text="{fieldText.label}"
- opacity="{textEdit.text != '' ? 0 : 1}">
+ opacity="{textEdit.text == '' ? 1 : 0}">
<opacity>
<Behaviour>
<NumericAnimation property="opacity" duration="250"/>
diff --git a/examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml b/examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml
index 45bb18d..191da52 100644
--- a/examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml
+++ b/examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml
@@ -17,21 +17,21 @@
<resources>
<Script>
function edit() {
- if (!page.mouseGrabbed) {
+ if (!contactDetails.mouseGrabbed) {
fieldText.state='editing';
- page.mouseGrabbed=true;
+ contactDetails.mouseGrabbed=true;
}
}
function confirm() {
fieldText.text = textEdit.text;
fieldText.state='';
- page.mouseGrabbed=false;
+ contactDetails.mouseGrabbed=false;
fieldText.confirmed.emit();
}
function reset() {
textEdit.text = fieldText.text;
fieldText.state='';
- page.mouseGrabbed=false;
+ contactDetails.mouseGrabbed=false;
}
</Script>
</resources>
@@ -63,7 +63,7 @@
color="#505050"
font.italic="true"
text="{fieldText.label}"
- opacity="{textEdit.text != '' ? 0 : 1}">
+ opacity="{textEdit.text == '' ? 1 : 0}">
<opacity>
<Behaviour>
<NumericAnimation property="opacity" duration="250"/>
diff --git a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml b/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml
index a489e95..991d6a0 100644
--- a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml
+++ b/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml
@@ -14,11 +14,11 @@
print('removeButton.toggle()');
if (removeButton.state == 'opened') {
removeButton.state = '';
- page.mouseGrabbed=false;
+ contactDetails.mouseGrabbed=false;
} else {
- if (!page.mouseGrabbed) {
+ if (!contactDetails.mouseGrabbed) {
removeButton.state = 'opened';
- page.mouseGrabbed=true;
+ contactDetails.mouseGrabbed=true;
}
}
}
diff --git a/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml b/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml
index 6907676..e1df10c 100644
--- a/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml
+++ b/examples/declarative/tutorials/contacts/3_Collections/3_Collections.qml
@@ -3,7 +3,7 @@
<FocusRealm id="realm1" focus="false" width="280" height="320">
<GroupBox contents="ContactView1.qml" label="something" anchors.fill="{parent}"/>
<Rect id="box1" color="black" anchors.fill="{parent}" opacity="0.3">
- <MouseRegion anchors.fill="{parent}" onClicked="print('1'); realm1.focus=true; realm2.focus=false; realm3.focus=false; box1.opacity='0'; box2.opacity='0.3'; box3.opacity='0.3'" onPressed="" onPositionChanged=""/>
+ <MouseRegion anchors.fill="{parent}" onClicked="print('1'); realm1.focus=true; realm2.focus=false; realm3.focus=false; box1.opacity='0'; box2.opacity='0.3'; box3.opacity='0.3'"/>
<opacity>
<Behaviour>
<NumericAnimation property="opacity" duration="250"/>
@@ -14,7 +14,7 @@
<FocusRealm id="realm2" focus="false" width="280" height="320">
<GroupBox contents="ContactView2.qml" label="something" anchors.fill="{parent}"/>
<Rect id="box2" color="black" anchors.fill="{parent}" opacity="0.3">
- <MouseRegion anchors.fill="{parent}" onClicked="realm1.focus=false; realm2.focus=true; realm3.focus=false; box1.opacity='0.3'; box2.opacity='0'; box3.opacity='0.3'" onPressed="" onPositionChanged=""/>
+ <MouseRegion anchors.fill="{parent}" onClicked="realm1.focus=false; realm2.focus=true; realm3.focus=false; box1.opacity='0.3'; box2.opacity='0'; box3.opacity='0.3'"/>
<opacity>
<Behaviour>
<NumericAnimation property="opacity" duration="250"/>
@@ -25,7 +25,7 @@
<FocusRealm id="realm3" focus="true" width="280" height="320">
<GroupBox contents="ContactView3.qml" label="something" anchors.fill="{parent}"/>
<Rect id="box3" color="black" anchors.fill="{parent}" opacity="0.3">
- <MouseRegion anchors.fill="{parent}" onClicked="realm1.focus=false; realm2.focus=false; realm3.focus=true; box1.opacity='0.3'; box2.opacity='0.3'; box3.opacity='0'" onPressed="" onPositionChanged=""/>
+ <MouseRegion anchors.fill="{parent}" onClicked="realm1.focus=false; realm2.focus=false; realm3.focus=true; box1.opacity='0.3'; box2.opacity='0.3'; box3.opacity='0'"/>
<opacity>
<Behaviour>
<NumericAnimation property="opacity" duration="250"/>
diff --git a/examples/declarative/tutorials/contacts/3_Collections/FieldText.qml b/examples/declarative/tutorials/contacts/3_Collections/FieldText.qml
index 583c73e..199270c 100644
--- a/examples/declarative/tutorials/contacts/3_Collections/FieldText.qml
+++ b/examples/declarative/tutorials/contacts/3_Collections/FieldText.qml
@@ -63,7 +63,7 @@
color="#505050"
font.italic="true"
text="{fieldText.label}"
- opacity="{textEdit.text != '' ? 0 : 1}">
+ opacity="{textEdit.text == '' ? 1 : 0}">
<opacity>
<Behaviour>
<NumericAnimation property="opacity" duration="250"/>
diff --git a/examples/declarative/tutorials/contacts/Final/FieldText.qml b/examples/declarative/tutorials/contacts/Final/FieldText.qml
index a82cecd..93095be 100644
--- a/examples/declarative/tutorials/contacts/Final/FieldText.qml
+++ b/examples/declarative/tutorials/contacts/Final/FieldText.qml
@@ -63,7 +63,7 @@
color="#505050"
font.italic="true"
text="{fieldText.label}"
- opacity="{textEdit.text != '' ? 0 : 1}">
+ opacity="{textEdit.text == '' ? 1 : 0}">
<opacity>
<Behaviour>
<NumericAnimation property="opacity" duration="250"/>