diff options
Diffstat (limited to 'doc/src/snippets/declarative')
-rw-r--r-- | doc/src/snippets/declarative/animation.qml | 5 | ||||
-rw-r--r-- | doc/src/snippets/declarative/events.qml | 14 | ||||
-rw-r--r-- | doc/src/snippets/declarative/grid/grid.qml | 53 | ||||
-rw-r--r-- | doc/src/snippets/declarative/mousearea/mousearea-snippet.qml | 10 |
4 files changed, 67 insertions, 15 deletions
diff --git a/doc/src/snippets/declarative/animation.qml b/doc/src/snippets/declarative/animation.qml index 739d009..ae6142d 100644 --- a/doc/src/snippets/declarative/animation.qml +++ b/doc/src/snippets/declarative/animation.qml @@ -179,7 +179,7 @@ Rectangle { } //! [behavior animation] -//! [sequential animation] +//! [sequential animation] Rectangle { id: banner width: 150; height: 100; border.color: "black" @@ -216,7 +216,7 @@ Rectangle { NumberAnimation { target: deploy; property: "opacity"; to: 1.0; duration: 200} } } -//! [sequential animation] +//! [sequential animation] }//end of col //! [parent end] @@ -224,4 +224,3 @@ Rectangle { //! [parent end] //! [document] - diff --git a/doc/src/snippets/declarative/events.qml b/doc/src/snippets/declarative/events.qml index 52fc2bc..3dc44f2 100644 --- a/doc/src/snippets/declarative/events.qml +++ b/doc/src/snippets/declarative/events.qml @@ -63,7 +63,7 @@ onSend: { onPerform: console.log("perform signal emitted") //! [signal handler declaration] -//! [automatic signals] +//! [automatic signals] Rectangle { id: sprite width: 25; height: 25 @@ -72,7 +72,7 @@ Rectangle { onXChanged: console.log("x property changed, emitted xChanged signal") onYChanged: console.log("y property changed, emitted yChanged signal") } -//! [automatic signals] +//! [automatic signals] //! [signal emit] Rectangle { @@ -88,7 +88,7 @@ Rectangle { } //! [signal emit] -//! [connect method] +//! [connect method] Rectangle { id: relay @@ -112,9 +112,9 @@ Rectangle { console.log("Sending to email: " + person + ", " + notice) } } -//! [connect method] +//! [connect method] -//! [forward signal] +//! [forward signal] Rectangle { id: forwarder width: 100; height: 100 @@ -131,9 +131,9 @@ Rectangle { mousearea.clicked.connect(send) } } -//! [forward signal] +//! [forward signal] -//! [connect method] +//! [connect method] //![parent end] } //![parent end] diff --git a/doc/src/snippets/declarative/grid/grid.qml b/doc/src/snippets/declarative/grid/grid.qml new file mode 100644 index 0000000..758edde --- /dev/null +++ b/doc/src/snippets/declarative/grid/grid.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [document] +import QtQuick 1.0 + +Grid { + columns: 3 + spacing: 2 + Rectangle { color: "red"; width: 50; height: 50 } + Rectangle { color: "green"; width: 20; height: 50 } + Rectangle { color: "blue"; width: 50; height: 20 } + Rectangle { color: "cyan"; width: 50; height: 50 } + Rectangle { color: "magenta"; width: 10; height: 10 } +} +//! [document] diff --git a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml index 99cdc8b..03473ba 100644 --- a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml +++ b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml @@ -47,7 +47,7 @@ Rectangle { width: 500; height: 500 color: "green" -Column { +Column { //! [anchor fill] Rectangle { id: button @@ -68,21 +68,21 @@ Rectangle { id: button width: 100; height: 100 -//! [enable handlers] +//! [enable handlers] MouseArea { hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton onEntered: console.log("mouse entered the area") onExited: console.log("mouse left the area") } -//! [enable handlers] +//! [enable handlers] } Rectangle { id: button width: 100; height: 100 -//! [mouse handlers] +//! [mouse handlers] MouseArea { anchors.fill: parent onClicked: console.log("area clicked") @@ -90,7 +90,7 @@ Rectangle { onEntered: console.log("mouse entered the area") onExited: console.log("mouse left the area") } -//! [mouse handlers] +//! [mouse handlers] } } //end of column |