From 4eee67a60a173ba16ee3154377da7f410cabe168 Mon Sep 17 00:00:00 2001 From: Ian Walters Date: Fri, 24 Apr 2009 15:08:03 +1000 Subject: Further tutorial work. Draft of second chapter. --- doc/src/tutorials/declarative.qdoc | 256 ++++++++++++++++++++- .../tutorials/contacts/2_Reuse/2_Reuse.qml | 3 - .../tutorials/contacts/2_Reuse/Contact4.qml | 3 + .../tutorials/contacts/2_Reuse/FieldText3.qml | 2 +- .../tutorials/contacts/2_Reuse/FieldText4.qml | 10 +- .../tutorials/contacts/2_Reuse/RemoveButton4.qml | 6 +- .../contacts/3_Collections/3_Collections.qml | 6 +- .../tutorials/contacts/3_Collections/FieldText.qml | 2 +- .../tutorials/contacts/Final/FieldText.qml | 2 +- 9 files changed, 271 insertions(+), 19 deletions(-) diff --git a/doc/src/tutorials/declarative.qdoc b/doc/src/tutorials/declarative.qdoc index be8fad9..ae2dcca 100644 --- a/doc/src/tutorials/declarative.qdoc +++ b/doc/src/tutorials/declarative.qdoc @@ -82,7 +82,7 @@ \list 1 \o \l{tutorials/declarative/contacts/part1}{Drawing and Animation} - \o \l{tutorials/declarative/contacts/part2}{Reuse of QML components} + \o \l{tutorials/declarative/contacts/part2}{Reusing QML Components} \o \l{tutorials/declarative/contacts/part3}{Models, Views and Delegates} \o \l{tutorials/declarative/contacts/part4}{Other Tricks} \endlist @@ -462,9 +462,261 @@ to complete their transition. \omit - TODO More on types of animation + TODO More on types of animation, e.g. ColorAnimation, Behaviors. \endomit In the next chapter we will show how we can use the remove button in other QML components. */ + +/*! + \page tutorials-declarative-contacts-part2.html + \contentspage {Declarative UI Tutorial}{Contents} + \previouspage {tutorials/declarative/contacts/part1}{Chapter 1} + \nextpage {tutorials/declarative/contacts/part3}{Chapter 3} + \example tutorials/declarative/contacts/part2 + \title Reusing QML Components + \tableofcontents + + The second part of this tutorial covers how to reuse QML components and + have them interact with each other. The RemoveButton developed in the + previous chapter is intended to be part of a more complex control for + editing a field of our contact. This ContactField in turn is intended + to be used in a contact editing control. + + \section1 Loading QML Components + + Reusing the RemoveButton itself is very simple. When parsing a QML file + if a Component is refered to that isn't already in the system, Qt + will try to load it from a file of the same name with the ".qml" extension. + + \code + + + \endcode + + The above QML code will attempt to load the RemoveButton component from + a file called "RemoveButton.qml". All the properties of the button are + accessible and can be overridden from defaults. The loaded component + can also refer to elements further up in the tree, so that code within + RemoveButton.qml could refer to the contactField component. However only + properties of the top level element in RemoveButton.qml are visible to + the contact field. In order to allow contact field to modify how wide + the remove button will be when opened we need to add a property to the + remove button. + + \section1 Properties and Signals + + \code + + + + + + + + \endcode + + \omit + Need reference for more information on declaring properties and signals. + \endomit + + These properties and signals are accessed from the contact field the same + way standard system components are accessed. + + \code + + + \endcode + + Now when the remove button is expanded, it will expand to the width of the + contact field. Also when the user confirms the remove action, the + text section of the contact field will be cleared. When creating a + component that does have children out of its own + bounds its important to consider whether the item should be clipped, + which is done above with \c{clip="true"}. + + \section1 States + + Its also possible to access the state of included components. The FieldText + component we will use in this tutorial is also been written specifically + for our contacts application, as was the RemoveButton component. In + this case we want it to expand when editing. One way to do this would + be to anchor the field text component to the center of its parent and + then let its own width change push the remove button away, however that + would make it difficult to have the remove button also push the field + text to the left when the remove button expands. + + So instead we will anchor the right edge of the field text to + the left edge of the remove button and use a state change in the + contact field itself to move the remove button and the field icon out of + view. + + \code + + + + + + + + + + + + + + + + + + + + + + \endcode + + Apart from accessing the fieldText.state, the above code also uses the when + attribute of its own editingText state. This is an alternative to using + a signal to change state. When the value of the expression for the + when attribute changes, Qt will detect if the contactField needs to enter + that state. In the FieldText element a similar approach is used to fade + out the label of the FieldText when the user enters some text of their own. + + \code + + + + + + + + \endcode + + fieldText is the enclosing component and textEdit is a TextEdit element + provided by Qt. In the QML code above, the opacity of the textLabel is + only 1 if there is text for the textEdit is empty. This is a form of + short cut to using states for an element, useful if only one property + is changing as it is for the textLabel. To animate a property change is + similar to animating a state change. Using the Behavior element we can + specify how the property changes if it does change state, allowing for + a smooth transition. + + The fieldText element also handles changes to the text using the + onValueChanged attribute when specifying properties. + + \code + + + + \endcode + + Because the user needs to be able to edit text in the text edit, it + shouldn't be simply bound to the text property of the FieldText component. + However if a component using the FieldText component sets the text + property of the FieldText component it should in turn set the text + of the text edit. + + \section1 Key and Mouse Focus + + Unlike in Qt setting focus to true on a component does not always mean + that the component has focus. This is due to the declarative nature + of QML, and can be affected by multiple components both indicating + focus to be true. At the time of writing this tutorial both key and mouse + focus handling are still being improved. Hence we will only lightly cover + the topic. + + Normally in QML this is handled by FocusRealm components. A focus realm + is a sort of cut off point for determining focus. If a FocusRealm does + not have focus then any children of it won't be able to get focus even + if they do set focus to true. If your component has multiple child + components that could gain focus ensure that they are guarded by FocusRealm + component, and add code to handle which focus realms have focus + at that level. The alternative and approach done at this stage in + the tutorial is to only have one component set focus to true at a time. + + Currently if multiple contact fields were put into our contact editor, + any of the FieldText components could be clicked and opened, and + any of the RemoveButton components could be clicked and opened, all + at the same time. We would like this behavior to be some what modal + instead, encouraging the user to either accept or cancel the current + action before moving onto a new action. + + In the tutorial we do this with a property of our top level component + to handle whether we are in this state or not. + + \code + + + + + \endcode + + And in the code where we want to check or avoid allowing mouse interaction. + + \code + + \endcode + + Handling Key and Mouse focus in QML is quite likely to change before + the Qt 4.6 release. +*/ + 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 @@ - - - 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}"> + + + 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}"> 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 @@ @@ -63,7 +63,7 @@ color="#505050" font.italic="true" text="{fieldText.label}" - opacity="{textEdit.text != '' ? 0 : 1}"> + opacity="{textEdit.text == '' ? 1 : 0}"> 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 @@ - + @@ -14,7 +14,7 @@ - + @@ -25,7 +25,7 @@ - + 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}"> 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}"> -- cgit v0.12 From 75e867d56b12626d3db13d21b6d55c5cebaf9858 Mon Sep 17 00:00:00 2001 From: Ian Walters Date: Tue, 28 Apr 2009 10:12:47 +1000 Subject: Reorg so that snippets are more readable. Reorg not complete though. May implement use of namespace features in chapter 2 so that can reduce duplicated files in chapter 3. --- .../1_Drawing_and_Animation/1/Removebutton.qml | 4 + .../1_Drawing_and_animation.qml | 12 +-- .../1_Drawing_and_Animation/2/RemoveButton.qml | 10 +++ .../1_Drawing_and_Animation/3/RemoveButton.qml | 23 ++++++ .../1_Drawing_and_Animation/4/RemoveButton.qml | 65 +++++++++++++++ .../1_Drawing_and_Animation/5/RemoveButton.qml | 70 ++++++++++++++++ .../contacts/1_Drawing_and_Animation/GroupBox.qml | 12 ++- .../1_Drawing_and_Animation/RemoveButton1.qml | 4 - .../1_Drawing_and_Animation/RemoveButton2.qml | 10 --- .../1_Drawing_and_Animation/RemoveButton3.qml | 23 ------ .../1_Drawing_and_Animation/RemoveButton4.qml | 65 --------------- .../1_Drawing_and_Animation/RemoveButton5.qml | 70 ---------------- .../tutorials/contacts/2_Reuse/1/ContactField.qml | 18 ++++ .../tutorials/contacts/2_Reuse/1/RemoveButton.qml | 70 ++++++++++++++++ .../tutorials/contacts/2_Reuse/2/ContactField.qml | 20 +++++ .../tutorials/contacts/2_Reuse/2/RemoveButton.qml | 76 +++++++++++++++++ .../tutorials/contacts/2_Reuse/2_Reuse.qml | 12 +-- .../tutorials/contacts/2_Reuse/3/Contact.qml | 29 +++++++ .../tutorials/contacts/2_Reuse/3/ContactField.qml | 36 ++++++++ .../tutorials/contacts/2_Reuse/3/FieldText.qml | 91 ++++++++++++++++++++ .../tutorials/contacts/2_Reuse/3/RemoveButton.qml | 76 +++++++++++++++++ .../tutorials/contacts/2_Reuse/4/Contact.qml | 32 ++++++++ .../tutorials/contacts/2_Reuse/4/ContactField.qml | 35 ++++++++ .../tutorials/contacts/2_Reuse/4/FieldText.qml | 96 ++++++++++++++++++++++ .../tutorials/contacts/2_Reuse/4/RemoveButton.qml | 80 ++++++++++++++++++ .../tutorials/contacts/2_Reuse/Contact3.qml | 29 ------- .../tutorials/contacts/2_Reuse/Contact4.qml | 32 -------- .../tutorials/contacts/2_Reuse/ContactField1.qml | 18 ---- .../tutorials/contacts/2_Reuse/ContactField2.qml | 20 ----- .../tutorials/contacts/2_Reuse/ContactField3.qml | 36 -------- .../tutorials/contacts/2_Reuse/ContactField4.qml | 35 -------- .../tutorials/contacts/2_Reuse/FieldText3.qml | 91 -------------------- .../tutorials/contacts/2_Reuse/FieldText4.qml | 96 ---------------------- .../tutorials/contacts/2_Reuse/GroupBox.qml | 12 ++- .../tutorials/contacts/2_Reuse/RemoveButton1.qml | 70 ---------------- .../tutorials/contacts/2_Reuse/RemoveButton2.qml | 76 ----------------- .../tutorials/contacts/2_Reuse/RemoveButton3.qml | 76 ----------------- .../tutorials/contacts/2_Reuse/RemoveButton4.qml | 80 ------------------ .../tutorials/contacts/3_Collections/1/Button.qml | 38 +++++++++ .../tutorials/contacts/3_Collections/1/Contact.qml | 28 +++++++ .../contacts/3_Collections/1/ContactField.qml | 35 ++++++++ .../contacts/3_Collections/1/ContactView.qml | 28 +++++++ .../contacts/3_Collections/1/FieldText.qml | 96 ++++++++++++++++++++++ .../contacts/3_Collections/1/RemoveButton.qml | 80 ++++++++++++++++++ .../tutorials/contacts/3_Collections/2/Button.qml | 38 +++++++++ .../tutorials/contacts/3_Collections/2/Contact.qml | 28 +++++++ .../contacts/3_Collections/2/ContactField.qml | 35 ++++++++ .../contacts/3_Collections/2/ContactView.qml | 69 ++++++++++++++++ .../contacts/3_Collections/2/FieldText.qml | 96 ++++++++++++++++++++++ .../contacts/3_Collections/2/RemoveButton.qml | 80 ++++++++++++++++++ .../tutorials/contacts/3_Collections/3/Button.qml | 38 +++++++++ .../tutorials/contacts/3_Collections/3/Contact.qml | 28 +++++++ .../contacts/3_Collections/3/ContactField.qml | 35 ++++++++ .../contacts/3_Collections/3/ContactView.qml | 74 +++++++++++++++++ .../contacts/3_Collections/3/FieldText.qml | 96 ++++++++++++++++++++++ .../contacts/3_Collections/3/RemoveButton.qml | 80 ++++++++++++++++++ .../contacts/3_Collections/3_Collections.qml | 41 ++------- .../tutorials/contacts/3_Collections/Button.qml | 38 --------- .../tutorials/contacts/3_Collections/Contact.qml | 28 ------- .../contacts/3_Collections/ContactField.qml | 35 -------- .../contacts/3_Collections/ContactView1.qml | 28 ------- .../contacts/3_Collections/ContactView2.qml | 68 --------------- .../contacts/3_Collections/ContactView3.qml | 73 ---------------- .../tutorials/contacts/3_Collections/FieldText.qml | 96 ---------------------- .../tutorials/contacts/3_Collections/GroupBox.qml | 12 ++- .../contacts/3_Collections/RemoveButton.qml | 80 ------------------ 66 files changed, 1883 insertions(+), 1328 deletions(-) create mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1/Removebutton.qml create mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/2/RemoveButton.qml create mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/3/RemoveButton.qml create mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4/RemoveButton.qml create mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/5/RemoveButton.qml delete mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton1.qml delete mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton2.qml delete mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton3.qml delete mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton4.qml delete mode 100644 examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton5.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/1/ContactField.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/1/RemoveButton.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/2/ContactField.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/2/RemoveButton.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/3/ContactField.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/3/FieldText.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/3/RemoveButton.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/4/ContactField.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/4/FieldText.qml create mode 100644 examples/declarative/tutorials/contacts/2_Reuse/4/RemoveButton.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/Contact3.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/ContactField1.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/ContactField2.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/ContactField3.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/ContactField4.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/RemoveButton1.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/RemoveButton2.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/RemoveButton3.qml delete mode 100644 examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/1/Button.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/1/Contact.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/1/ContactField.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/1/ContactView.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/1/FieldText.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/1/RemoveButton.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/2/Button.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/2/Contact.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/2/ContactField.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/2/ContactView.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/2/FieldText.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/2/RemoveButton.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/3/Button.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/3/Contact.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/3/ContactField.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/3/ContactView.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/3/FieldText.qml create mode 100644 examples/declarative/tutorials/contacts/3_Collections/3/RemoveButton.qml delete mode 100644 examples/declarative/tutorials/contacts/3_Collections/Button.qml delete mode 100644 examples/declarative/tutorials/contacts/3_Collections/Contact.qml delete mode 100644 examples/declarative/tutorials/contacts/3_Collections/ContactField.qml delete mode 100644 examples/declarative/tutorials/contacts/3_Collections/ContactView1.qml delete mode 100644 examples/declarative/tutorials/contacts/3_Collections/ContactView2.qml delete mode 100644 examples/declarative/tutorials/contacts/3_Collections/ContactView3.qml delete mode 100644 examples/declarative/tutorials/contacts/3_Collections/FieldText.qml delete mode 100644 examples/declarative/tutorials/contacts/3_Collections/RemoveButton.qml diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1/Removebutton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1/Removebutton.qml new file mode 100644 index 0000000..dc3f505 --- /dev/null +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1/Removebutton.qml @@ -0,0 +1,4 @@ + diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1_Drawing_and_animation.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1_Drawing_and_animation.qml index 4ea77f3..31a95c6 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1_Drawing_and_animation.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/1_Drawing_and_animation.qml @@ -1,9 +1,9 @@ - - - - - - + + + + + + diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/2/RemoveButton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/2/RemoveButton.qml new file mode 100644 index 0000000..d3cb045 --- /dev/null +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/2/RemoveButton.qml @@ -0,0 +1,10 @@ + + + diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/3/RemoveButton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/3/RemoveButton.qml new file mode 100644 index 0000000..257686f --- /dev/null +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/3/RemoveButton.qml @@ -0,0 +1,23 @@ + + + + + diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4/RemoveButton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4/RemoveButton.qml new file mode 100644 index 0000000..6d97db1 --- /dev/null +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4/RemoveButton.qml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/5/RemoveButton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/5/RemoveButton.qml new file mode 100644 index 0000000..ddb3507 --- /dev/null +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/5/RemoveButton.qml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml index 01f26ee..77f7093 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/GroupBox.qml @@ -1,4 +1,4 @@ - + @@ -14,4 +14,12 @@ - + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton1.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton1.qml deleted file mode 100644 index dc3f505..0000000 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton1.qml +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton2.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton2.qml deleted file mode 100644 index 2ba488d..0000000 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton2.qml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton3.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton3.qml deleted file mode 100644 index 9a364c5..0000000 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton3.qml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton4.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton4.qml deleted file mode 100644 index 45ca19d..0000000 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton4.qml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton5.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton5.qml deleted file mode 100644 index 68c1838..0000000 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/RemoveButton5.qml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/1/ContactField.qml b/examples/declarative/tutorials/contacts/2_Reuse/1/ContactField.qml new file mode 100644 index 0000000..6d8bb9f --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/1/ContactField.qml @@ -0,0 +1,18 @@ + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/1/RemoveButton.qml b/examples/declarative/tutorials/contacts/2_Reuse/1/RemoveButton.qml new file mode 100644 index 0000000..ddb3507 --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/1/RemoveButton.qml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/2/ContactField.qml b/examples/declarative/tutorials/contacts/2_Reuse/2/ContactField.qml new file mode 100644 index 0000000..5f8ff51 --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/2/ContactField.qml @@ -0,0 +1,20 @@ + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/2/RemoveButton.qml b/examples/declarative/tutorials/contacts/2_Reuse/2/RemoveButton.qml new file mode 100644 index 0000000..e52bcbf --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/2/RemoveButton.qml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml b/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml index 92afc0c..98fdb86 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/2_Reuse.qml @@ -1,9 +1,9 @@ - - - - - - + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml b/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml new file mode 100644 index 0000000..cf6c657 --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/3/Contact.qml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/3/ContactField.qml b/examples/declarative/tutorials/contacts/2_Reuse/3/ContactField.qml new file mode 100644 index 0000000..5748a81 --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/3/ContactField.qml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/3/FieldText.qml b/examples/declarative/tutorials/contacts/2_Reuse/3/FieldText.qml new file mode 100644 index 0000000..8010ac0 --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/3/FieldText.qml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/3/RemoveButton.qml b/examples/declarative/tutorials/contacts/2_Reuse/3/RemoveButton.qml new file mode 100644 index 0000000..e52bcbf --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/3/RemoveButton.qml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml b/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml new file mode 100644 index 0000000..2f4d540 --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/4/Contact.qml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/4/ContactField.qml b/examples/declarative/tutorials/contacts/2_Reuse/4/ContactField.qml new file mode 100644 index 0000000..819914c --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/4/ContactField.qml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/4/FieldText.qml b/examples/declarative/tutorials/contacts/2_Reuse/4/FieldText.qml new file mode 100644 index 0000000..0f2ef4e --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/4/FieldText.qml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/4/RemoveButton.qml b/examples/declarative/tutorials/contacts/2_Reuse/4/RemoveButton.qml new file mode 100644 index 0000000..14e5043 --- /dev/null +++ b/examples/declarative/tutorials/contacts/2_Reuse/4/RemoveButton.qml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/Contact3.qml b/examples/declarative/tutorials/contacts/2_Reuse/Contact3.qml deleted file mode 100644 index 2933437..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/Contact3.qml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml b/examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml deleted file mode 100644 index e87ed60..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/Contact4.qml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/ContactField1.qml b/examples/declarative/tutorials/contacts/2_Reuse/ContactField1.qml deleted file mode 100644 index 7bfdd28..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/ContactField1.qml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/ContactField2.qml b/examples/declarative/tutorials/contacts/2_Reuse/ContactField2.qml deleted file mode 100644 index 7ec3e4d..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/ContactField2.qml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/ContactField3.qml b/examples/declarative/tutorials/contacts/2_Reuse/ContactField3.qml deleted file mode 100644 index cef25ce..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/ContactField3.qml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/ContactField4.qml b/examples/declarative/tutorials/contacts/2_Reuse/ContactField4.qml deleted file mode 100644 index 13ccbc0..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/ContactField4.qml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml b/examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml deleted file mode 100644 index d09ad0b..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/FieldText3.qml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml b/examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml deleted file mode 100644 index 191da52..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/FieldText4.qml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/GroupBox.qml b/examples/declarative/tutorials/contacts/2_Reuse/GroupBox.qml index 01f26ee..77f7093 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/GroupBox.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/GroupBox.qml @@ -1,4 +1,4 @@ - + @@ -14,4 +14,12 @@ - + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton1.qml b/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton1.qml deleted file mode 100644 index 68c1838..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton1.qml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton2.qml b/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton2.qml deleted file mode 100644 index d9ff4c5..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton2.qml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton3.qml b/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton3.qml deleted file mode 100644 index d9ff4c5..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton3.qml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml b/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml deleted file mode 100644 index 991d6a0..0000000 --- a/examples/declarative/tutorials/contacts/2_Reuse/RemoveButton4.qml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/tutorials/contacts/3_Collections/1/Button.qml b/examples/declarative/tutorials/contacts/3_Collections/1/Button.qml new file mode 100644 index 0000000..8290d35 --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/1/Button.qml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/1/Contact.qml b/examples/declarative/tutorials/contacts/3_Collections/1/Contact.qml new file mode 100644 index 0000000..293b3a5 --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/1/Contact.qml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/1/ContactField.qml b/examples/declarative/tutorials/contacts/3_Collections/1/ContactField.qml new file mode 100644 index 0000000..819914c --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/1/ContactField.qml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/1/ContactView.qml b/examples/declarative/tutorials/contacts/3_Collections/1/ContactView.qml new file mode 100644 index 0000000..d48aa02 --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/1/ContactView.qml @@ -0,0 +1,28 @@ + + + + + + + + SELECT recid, label, email, phone FROM contacts ORDER BY label, recid + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/1/FieldText.qml b/examples/declarative/tutorials/contacts/3_Collections/1/FieldText.qml new file mode 100644 index 0000000..068590a --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/1/FieldText.qml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/1/RemoveButton.qml b/examples/declarative/tutorials/contacts/3_Collections/1/RemoveButton.qml new file mode 100644 index 0000000..ad488c1 --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/1/RemoveButton.qml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/2/Button.qml b/examples/declarative/tutorials/contacts/3_Collections/2/Button.qml new file mode 100644 index 0000000..8290d35 --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/2/Button.qml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/2/Contact.qml b/examples/declarative/tutorials/contacts/3_Collections/2/Contact.qml new file mode 100644 index 0000000..293b3a5 --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/2/Contact.qml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/2/ContactField.qml b/examples/declarative/tutorials/contacts/3_Collections/2/ContactField.qml new file mode 100644 index 0000000..819914c --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/2/ContactField.qml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/tutorials/contacts/3_Collections/2/ContactView.qml b/examples/declarative/tutorials/contacts/3_Collections/2/ContactView.qml new file mode 100644 index 0000000..c72d9ce --- /dev/null +++ b/examples/declarative/tutorials/contacts/3_Collections/2/ContactView.qml @@ -0,0 +1,69 @@ + + + + + + + + SELECT recid AS contactid, label, email, phone FROM contacts ORDER BY label, recid + + + + + + + + + + + + + + + + + + + + + + + if (wrapper.state == 'opened') { + wrapper.state = ''; + } + + + + +