diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-10-07 07:07:55 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-10-07 07:07:55 (GMT) |
commit | 28e0f484cfb2b677661f0cb1a90a7b88d8f46f03 (patch) | |
tree | 8150341c2dfa1d86e8e529af53744dc68d4da50b /doc/src/declarative/tutorial2.qdoc | |
parent | 6708bd626fd66725f249aeb36a59a355bb30c5da (diff) | |
download | Qt-28e0f484cfb2b677661f0cb1a90a7b88d8f46f03.zip Qt-28e0f484cfb2b677661f0cb1a90a7b88d8f46f03.tar.gz Qt-28e0f484cfb2b677661f0cb1a90a7b88d8f46f03.tar.bz2 |
move files to avoid duplication.
Diffstat (limited to 'doc/src/declarative/tutorial2.qdoc')
-rw-r--r-- | doc/src/declarative/tutorial2.qdoc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/src/declarative/tutorial2.qdoc b/doc/src/declarative/tutorial2.qdoc index 21b5ebd..a076a62 100644 --- a/doc/src/declarative/tutorial2.qdoc +++ b/doc/src/declarative/tutorial2.qdoc @@ -15,36 +15,36 @@ defined in its own QML file (for more details, see \l components). Here is the QML code for \c Cell.qml: -\snippet examples/declarative/tutorials/helloworld/t2/Cell.qml 0 +\snippet examples/declarative/tutorials/helloworld/Cell.qml 0 \section1 Walkthrough \section2 The Cell Component -\snippet examples/declarative/tutorials/helloworld/t2/Cell.qml 1 +\snippet examples/declarative/tutorials/helloworld/Cell.qml 1 The root element of our component is an \l Item with the \c id \e container. An \l Item is the most basic visual element in QML and is often used as a container for other elements. -\snippet examples/declarative/tutorials/helloworld/t2/Cell.qml 4 +\snippet examples/declarative/tutorials/helloworld/Cell.qml 4 We declare a \c color property. This property is accessible from \e outside our component, this allows us to instantiate the cells with different colors. This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{Properties}). -\snippet examples/declarative/tutorials/helloworld/t2/Cell.qml 5 +\snippet examples/declarative/tutorials/helloworld/Cell.qml 5 We want our component to also have a signal that we call \e clicked with a \e color parameter. We will use this signal to change the color of the text in the main QML file later. -\snippet examples/declarative/tutorials/helloworld/t2/Cell.qml 2 +\snippet examples/declarative/tutorials/helloworld/Cell.qml 2 Our cell component is basically a colored rectangle with the \c id \e rectangle. The \c anchors.fill property is a convenient way to set the size of an element. In this case the rectangle will have the same size as its parent (see \l{anchor-layout}{Anchor-based Layout}). -\snippet examples/declarative/tutorials/helloworld/t2/Cell.qml 3 +\snippet examples/declarative/tutorials/helloworld/Cell.qml 3 In order to change the color of the text when clicking on a cell, we create a \l MouseRegion element with the same size as its parent. @@ -56,11 +56,11 @@ When this signal is triggered we want to emit our own \e clicked signal with the In our main QML file, we use our \c Cell component to create the color picker: -\snippet examples/declarative/tutorials/helloworld/t2/tutorial2.qml 0 +\snippet examples/declarative/tutorials/helloworld/tutorial2.qml 0 We create the color picker by putting 6 cells with different colors in a grid. -\snippet examples/declarative/tutorials/helloworld/t2/tutorial2.qml 1 +\snippet examples/declarative/tutorials/helloworld/tutorial2.qml 1 When the \e clicked signal of our cell is triggered, we want to set the color of the text to the color passed as a parameter. We can react to any signal of our component through a property of the name \e 'onSignalName' (see \l{Signal Handlers}). |