diff options
Diffstat (limited to 'src/qml')
120 files changed, 408 insertions, 5587 deletions
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf index fdba644349..80f7cefb91 100644 --- a/src/qml/doc/qtqml.qdocconf +++ b/src/qml/doc/qtqml.qdocconf @@ -83,7 +83,8 @@ headerdirs += .. sourcedirs += .. -exampledirs += ../../../examples \ +exampledirs += ../../../ \ + ../../../examples \ ../ \ snippets diff --git a/src/qml/doc/snippets/qml/numberanimation.qml b/src/qml/doc/snippets/qml/DynamicText.qml index 404381863d..9711702037 100644 --- a/src/qml/doc/snippets/qml/numberanimation.qml +++ b/src/qml/doc/snippets/qml/DynamicText.qml @@ -41,11 +41,12 @@ //![0] import QtQuick 2.0 -Rectangle { - width: 100; height: 100 - color: "red" - - NumberAnimation on x { to: 50; duration: 1000 } +Text { + id: textElement + width: 200 + height: 200 + text: "Default text" + property string dynamicText: "Dynamic text" + onTextChanged: console.log(text) } //![0] - diff --git a/src/qml/doc/snippets/qml/anchorchanges.qml b/src/qml/doc/snippets/qml/anchorchanges.qml deleted file mode 100644 index 9cc9d15221..0000000000 --- a/src/qml/doc/snippets/qml/anchorchanges.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - id: window - width: 120; height: 120 - color: "black" - - Rectangle { id: myRect; width: 50; height: 50; color: "red" } - - states: State { - name: "reanchored" - - AnchorChanges { - target: myRect - anchors.top: window.top - anchors.bottom: window.bottom - } - PropertyChanges { - target: myRect - anchors.topMargin: 10 - anchors.bottomMargin: 10 - } - } - - MouseArea { anchors.fill: parent; onClicked: window.state = "reanchored" } -} -//![0] - diff --git a/src/qml/doc/snippets/qml/animatedimage.qml b/src/qml/doc/snippets/qml/animatedimage.qml deleted file mode 100644 index a483619e11..0000000000 --- a/src/qml/doc/snippets/qml/animatedimage.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -// This snippet should be turned into an example and put in -// examples/declarative/imageelements/animatedimage - -//! [document] -import QtQuick 2.0 - -Rectangle { - width: animation.width; height: animation.height + 8 - - AnimatedImage { id: animation; source: "animation.gif" } - - Rectangle { - property int frames: animation.frameCount - - width: 4; height: 8 - x: (animation.width - width) * animation.currentFrame / frames - y: animation.height - color: "red" - } -} -//! [document] diff --git a/src/qml/doc/snippets/qml/behavior.qml b/src/qml/doc/snippets/qml/behavior.qml deleted file mode 100644 index 4776e09a54..0000000000 --- a/src/qml/doc/snippets/qml/behavior.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Rectangle { - id: rect - width: 100; height: 100 - color: "red" - - Behavior on width { - NumberAnimation { duration: 1000 } - } - - MouseArea { - anchors.fill: parent - onClicked: rect.width = 50 - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/borderimage/borderimage-scaled.qml b/src/qml/doc/snippets/qml/borderimage/borderimage-scaled.qml deleted file mode 100644 index 468aa24eab..0000000000 --- a/src/qml/doc/snippets/qml/borderimage/borderimage-scaled.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: page - color: "white" - width: 180; height: 180 - -//! [scaled border image] -BorderImage { - width: 180; height: 180 - border { left: 30; top: 30; right: 30; bottom: 30 } - horizontalTileMode: BorderImage.Stretch - verticalTileMode: BorderImage.Stretch - source: "pics/borderframe.png" -} -//! [scaled border image] - - Rectangle { - x: 30; y: 0 - width: 1; height: 180 - color: "gray" - } - - Rectangle { - x: 150; y: 0 - width: 1; height: 180 - color: "gray" - } - - Rectangle { - x: 0; y: 30 - width: 180; height: 1 - color: "gray" - } - - Rectangle { - x: 0; y: 150 - width: 180; height: 1 - color: "gray" - } -} diff --git a/src/qml/doc/snippets/qml/borderimage/borderimage-tiled.qml b/src/qml/doc/snippets/qml/borderimage/borderimage-tiled.qml deleted file mode 100644 index 69297378bf..0000000000 --- a/src/qml/doc/snippets/qml/borderimage/borderimage-tiled.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: page - color: "white" - width: 180; height: 180 - -//! [tiled border image] -BorderImage { - width: 180; height: 180 - border { left: 30; top: 30; right: 30; bottom: 30 } - horizontalTileMode: BorderImage.Repeat - verticalTileMode: BorderImage.Repeat - source: "pics/borderframe.png" -} -//! [tiled border image] - - Rectangle { - x: 30; y: 0 - width: 1; height: 180 - color: "gray" - } - - Rectangle { - x: 150; y: 0 - width: 1; height: 180 - color: "gray" - } - - Rectangle { - x: 0; y: 30 - width: 180; height: 1 - color: "gray" - } - - Rectangle { - x: 0; y: 150 - width: 180; height: 1 - color: "gray" - } -} diff --git a/src/qml/doc/snippets/qml/borderimage/normal-image.qml b/src/qml/doc/snippets/qml/borderimage/normal-image.qml deleted file mode 100644 index 3bd34e3933..0000000000 --- a/src/qml/doc/snippets/qml/borderimage/normal-image.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: page - color: "white" - width: 120; height: 120 - -//! [normal image] -Image { - source: "pics/borderframe.png" -} -//! [normal image] - - Rectangle { - x: 30; y: 0 - width: 1; height: 120 - color: "gray" - } - - Rectangle { - x: 90; y: 0 - width: 1; height: 120 - color: "gray" - } - - Rectangle { - x: 0; y: 30 - width: 200; height: 1 - color: "gray" - } - - Rectangle { - x: 0; y: 90 - width: 200; height: 1 - color: "gray" - } -} diff --git a/src/qml/doc/snippets/qml/coloranimation.qml b/src/qml/doc/snippets/qml/coloranimation.qml deleted file mode 100644 index bb2d83bfb8..0000000000 --- a/src/qml/doc/snippets/qml/coloranimation.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Rectangle { - width: 100; height: 100 - color: "red" - - ColorAnimation on color { to: "yellow"; duration: 1000 } -} -//![0] - diff --git a/src/qml/doc/snippets/qml/column/column-transitions.qml b/src/qml/doc/snippets/qml/column/column-transitions.qml deleted file mode 100644 index 8e291b12c8..0000000000 --- a/src/qml/doc/snippets/qml/column/column-transitions.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//! [document] -Column { - spacing: 2 - - Rectangle { color: "red"; width: 50; height: 50 } - Rectangle { id: greenRect; color: "green"; width: 20; height: 50 } - Rectangle { color: "blue"; width: 50; height: 20 } - - move: Transition { - NumberAnimation { properties: "x,y"; duration: 1000 } - } - - focus: true - Keys.onSpacePressed: greenRect.visible = !greenRect.visible -} -//! [document] diff --git a/src/qml/doc/snippets/qml/column/vertical-positioner.qml b/src/qml/doc/snippets/qml/column/vertical-positioner.qml deleted file mode 100644 index 1661c46ba8..0000000000 --- a/src/qml/doc/snippets/qml/column/vertical-positioner.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//! [document] -Column { - spacing: 2 - - Rectangle { color: "red"; width: 50; height: 50 } - Rectangle { color: "green"; width: 20; height: 50 } - Rectangle { color: "blue"; width: 50; height: 20 } -} -//! [document] diff --git a/src/qml/doc/snippets/qml/drag.qml b/src/qml/doc/snippets/qml/drag.qml deleted file mode 100644 index 286fcfc52b..0000000000 --- a/src/qml/doc/snippets/qml/drag.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Item { - width: 200; height: 200 - - DropArea { - x: 75; y: 75 - width: 50; height: 50 - - Rectangle { - anchors.fill: parent - color: "green" - - visible: parent.containsDrag - } - } - - Rectangle { - x: 10; y: 10 - width: 20; height: 20 - color: "red" - - Drag.active: dragArea.drag.active - Drag.hotSpot.x: 10 - Drag.hotSpot.y: 10 - - MouseArea { - id: dragArea - anchors.fill: parent - - drag.target: parent - } - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/flickable.qml b/src/qml/doc/snippets/qml/flickable.qml deleted file mode 100644 index fda2615e14..0000000000 --- a/src/qml/doc/snippets/qml/flickable.qml +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 2.0 - -Flickable { - width: 200; height: 200 - contentWidth: image.width; contentHeight: image.height - - Image { id: image; source: "bigImage.png" } -} -//! [document] diff --git a/src/qml/doc/snippets/qml/flickableScrollbar.qml b/src/qml/doc/snippets/qml/flickableScrollbar.qml deleted file mode 100644 index fd0aee3fc1..0000000000 --- a/src/qml/doc/snippets/qml/flickableScrollbar.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//![0] -Rectangle { - width: 200; height: 200 - - Flickable { - id: flickable -//![0] - anchors.fill: parent - contentWidth: image.width; contentHeight: image.height - - Image { id: image; source: "pics/qt.png" } -//![1] - } - - Rectangle { - id: scrollbar - anchors.right: flickable.right - y: flickable.visibleArea.yPosition * flickable.height - width: 10 - height: flickable.visibleArea.heightRatio * flickable.height - color: "black" - } -} -//![1] diff --git a/src/qml/doc/snippets/qml/flipable/flipable.qml b/src/qml/doc/snippets/qml/flipable/flipable.qml deleted file mode 100644 index 4e451204d4..0000000000 --- a/src/qml/doc/snippets/qml/flipable/flipable.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//! [0] -import QtQuick 2.0 - -Flipable { - id: flipable - width: 240 - height: 240 - - property bool flipped: false - - front: Image { source: "front.png"; anchors.centerIn: parent } - back: Image { source: "back.png"; anchors.centerIn: parent } - - transform: Rotation { - id: rotation - origin.x: flipable.width/2 - origin.y: flipable.height/2 - axis.x: 0; axis.y: 1; axis.z: 0 // set axis.y to 1 to rotate around y-axis - angle: 0 // the default angle - } - - states: State { - name: "back" - PropertyChanges { target: rotation; angle: 180 } - when: flipable.flipped - } - - transitions: Transition { - NumberAnimation { target: rotation; property: "angle"; duration: 4000 } - } - - MouseArea { - anchors.fill: parent - onClicked: flipable.flipped = !flipable.flipped - } -} -//! [0] - diff --git a/src/qml/doc/snippets/qml/flow.qml b/src/qml/doc/snippets/qml/flow.qml deleted file mode 100644 index 1141269986..0000000000 --- a/src/qml/doc/snippets/qml/flow.qml +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 2.0 - -Rectangle { - color: "lightblue" - width: 300; height: 200 - -//! [flow item] - Flow { - anchors.fill: parent - anchors.margins: 4 - spacing: 10 - - Text { text: "Text"; font.pixelSize: 40 } - Text { text: "items"; font.pixelSize: 40 } - Text { text: "flowing"; font.pixelSize: 40 } - Text { text: "inside"; font.pixelSize: 40 } - Text { text: "a"; font.pixelSize: 40 } - Text { text: "Flow"; font.pixelSize: 40 } - Text { text: "item"; font.pixelSize: 40 } - } -//! [flow item] -} -//! [document] diff --git a/src/qml/doc/snippets/qml/gradient.qml b/src/qml/doc/snippets/qml/gradient.qml deleted file mode 100644 index a5af6a7930..0000000000 --- a/src/qml/doc/snippets/qml/gradient.qml +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//![code] -Rectangle { - width: 100; height: 100 - gradient: Gradient { - GradientStop { position: 0.0; color: "red" } - GradientStop { position: 0.33; color: "yellow" } - GradientStop { position: 1.0; color: "green" } - } -} -//![code] diff --git a/src/qml/doc/snippets/qml/grid/grid.qml b/src/qml/doc/snippets/qml/grid/grid.qml deleted file mode 100644 index 7fb1bb6f5a..0000000000 --- a/src/qml/doc/snippets/qml/grid/grid.qml +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 2.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/src/qml/doc/snippets/qml/gridview/ContactModel.qml b/src/qml/doc/snippets/qml/gridview/ContactModel.qml deleted file mode 100644 index f744c1e73f..0000000000 --- a/src/qml/doc/snippets/qml/gridview/ContactModel.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -ListModel { - - ListElement { - name: "Jim Williams" - portrait: "pics/portrait.png" - } - ListElement { - name: "John Brown" - portrait: "pics/portrait.png" - } - ListElement { - name: "Bill Smyth" - portrait: "pics/portrait.png" - } - ListElement { - name: "Sam Wise" - portrait: "pics/portrait.png" - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/gridview/gridview.qml b/src/qml/doc/snippets/qml/gridview/gridview.qml deleted file mode 100644 index d3b37d1338..0000000000 --- a/src/qml/doc/snippets/qml/gridview/gridview.qml +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![import] -import QtQuick 2.0 -//![import] - -Rectangle { - width: childrenRect.width; height: childrenRect.height - -Row { - -//![classdocs simple] -GridView { - width: 300; height: 200 - - model: ContactModel {} - delegate: Column { - Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter } - Text { text: name; anchors.horizontalCenter: parent.horizontalCenter } - } -} -//![classdocs simple] - - -//![classdocs advanced] -Rectangle { - width: 300; height: 200 - - Component { - id: contactDelegate - Item { - width: grid.cellWidth; height: grid.cellHeight - Column { - anchors.fill: parent - Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter } - Text { text: name; anchors.horizontalCenter: parent.horizontalCenter } - } - } - } - - GridView { - id: grid - anchors.fill: parent - cellWidth: 80; cellHeight: 80 - - model: ContactModel {} - delegate: contactDelegate - highlight: Rectangle { color: "lightsteelblue"; radius: 5 } - focus: true - } -} -//![classdocs advanced] - -//![delayRemove] -Component { - id: delegate - Item { - GridView.onRemove: SequentialAnimation { - PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad } - PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false } - } - } -} -//![delayRemove] - -//![highlightFollowsCurrentItem] -Component { - id: highlight - Rectangle { - width: view.cellWidth; height: view.cellHeight - color: "lightsteelblue"; radius: 5 - x: view.currentItem.x - y: view.currentItem.y - Behavior on x { SpringAnimation { spring: 3; damping: 0.2 } } - Behavior on y { SpringAnimation { spring: 3; damping: 0.2 } } - } -} - -GridView { - id: view - width: 300; height: 200 - cellWidth: 80; cellHeight: 80 - - model: ContactModel {} - delegate: Column { - Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter } - Text { text: name; anchors.horizontalCenter: parent.horizontalCenter } - } - - highlight: highlight - highlightFollowsCurrentItem: false - focus: true -} -//![highlightFollowsCurrentItem] - -//![isCurrentItem] -GridView { - width: 300; height: 200 - cellWidth: 80; cellHeight: 80 - - Component { - id: contactsDelegate - Rectangle { - id: wrapper - width: 80 - height: 80 - color: GridView.isCurrentItem ? "black" : "red" - Text { - id: contactInfo - text: name + ": " + number - color: wrapper.GridView.isCurrentItem ? "red" : "black" - } - } - } - - model: ContactModel {} - delegate: contactsDelegate - focus: true -} -//![isCurrentItem] - -} - -} diff --git a/src/qml/doc/snippets/qml/image.qml b/src/qml/doc/snippets/qml/image.qml deleted file mode 100644 index 61724ffeea..0000000000 --- a/src/qml/doc/snippets/qml/image.qml +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 2.0 - -Image { - source: "pics/qtlogo.png" -} -//! [document] diff --git a/src/qml/doc/snippets/qml/keynavigation.qml b/src/qml/doc/snippets/qml/keynavigation.qml deleted file mode 100644 index 4854ecd0ed..0000000000 --- a/src/qml/doc/snippets/qml/keynavigation.qml +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Grid { - width: 100; height: 100 - columns: 2 - - Rectangle { - id: topLeft - width: 50; height: 50 - color: focus ? "red" : "lightgray" - focus: true - - KeyNavigation.right: topRight - KeyNavigation.down: bottomLeft - } - - Rectangle { - id: topRight - width: 50; height: 50 - color: focus ? "red" : "lightgray" - - KeyNavigation.left: topLeft - KeyNavigation.down: bottomRight - } - - Rectangle { - id: bottomLeft - width: 50; height: 50 - color: focus ? "red" : "lightgray" - - KeyNavigation.right: bottomRight - KeyNavigation.up: topLeft - } - - Rectangle { - id: bottomRight - width: 50; height: 50 - color: focus ? "red" : "lightgray" - - KeyNavigation.left: bottomLeft - KeyNavigation.up: topRight - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/keys/keys-handler.qml b/src/qml/doc/snippets/qml/keys/keys-handler.qml deleted file mode 100644 index 21fc98e23d..0000000000 --- a/src/qml/doc/snippets/qml/keys/keys-handler.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - width: 400; height: 400 - -//! [key item] -Item { - anchors.fill: parent - focus: true - Keys.onLeftPressed: console.log("move left") -} -//! [key item] - -Text { - anchors.fill: parent - text: "Press a cursor key" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter -} -} diff --git a/src/qml/doc/snippets/qml/keys/keys-pressed.qml b/src/qml/doc/snippets/qml/keys/keys-pressed.qml deleted file mode 100644 index 3c9a2d9dce..0000000000 --- a/src/qml/doc/snippets/qml/keys/keys-pressed.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - width: 400; height: 400 - -//! [key item] -Item { - anchors.fill: parent - focus: true - Keys.onPressed: { - if (event.key == Qt.Key_Left) { - console.log("move left"); - event.accepted = true; - } - } -} -//! [key item] - -Text { - anchors.fill: parent - text: "Press a cursor key" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter -} -} diff --git a/src/qml/doc/snippets/qml/layoutmirroring.qml b/src/qml/doc/snippets/qml/layoutmirroring.qml deleted file mode 100644 index 5daf3f58b3..0000000000 --- a/src/qml/doc/snippets/qml/layoutmirroring.qml +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - LayoutMirroring.enabled: true - LayoutMirroring.childrenInherit: true - - width: 300; height: 50 - color: "yellow" - border.width: 1 - - Row { - anchors { left: parent.left; margins: 5 } - y: 5; spacing: 5 - - Repeater { - model: 5 - - Rectangle { - color: "red" - opacity: (5 - index) / 5 - width: 40; height: 40 - - Text { - text: index + 1 - anchors.centerIn: parent - } - } - } - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/qml-data-models/listelements.qml b/src/qml/doc/snippets/qml/listmodel/listelements.qml index 0097423142..0097423142 100644 --- a/src/qml/doc/snippets/qml/qml-data-models/listelements.qml +++ b/src/qml/doc/snippets/qml/listmodel/listelements.qml diff --git a/src/qml/doc/snippets/qml/listmodel-modify.qml b/src/qml/doc/snippets/qml/listmodel/listmodel-modify.qml index 308453b393..308453b393 100644 --- a/src/qml/doc/snippets/qml/listmodel-modify.qml +++ b/src/qml/doc/snippets/qml/listmodel/listmodel-modify.qml diff --git a/src/qml/doc/snippets/qml/listmodel-nested.qml b/src/qml/doc/snippets/qml/listmodel/listmodel-nested.qml index bac95608e1..bac95608e1 100644 --- a/src/qml/doc/snippets/qml/listmodel-nested.qml +++ b/src/qml/doc/snippets/qml/listmodel/listmodel-nested.qml diff --git a/src/qml/doc/snippets/qml/listmodel-simple.qml b/src/qml/doc/snippets/qml/listmodel/listmodel-simple.qml index e8c4cea68e..e8c4cea68e 100644 --- a/src/qml/doc/snippets/qml/listmodel-simple.qml +++ b/src/qml/doc/snippets/qml/listmodel/listmodel-simple.qml diff --git a/src/qml/doc/snippets/qml/listmodel.qml b/src/qml/doc/snippets/qml/listmodel/listmodel.qml index e93732e2ee..e93732e2ee 100644 --- a/src/qml/doc/snippets/qml/listmodel.qml +++ b/src/qml/doc/snippets/qml/listmodel/listmodel.qml diff --git a/src/qml/doc/snippets/qml/listview/ContactModel.qml b/src/qml/doc/snippets/qml/listview/ContactModel.qml deleted file mode 100644 index 395c637b6a..0000000000 --- a/src/qml/doc/snippets/qml/listview/ContactModel.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -ListModel { - ListElement { - name: "Bill Smith" - number: "555 3264" - } - ListElement { - name: "John Brown" - number: "555 8426" - } - ListElement { - name: "Sam Wise" - number: "555 0473" - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/listview/listview.qml b/src/qml/doc/snippets/qml/listview/listview.qml deleted file mode 100644 index 689e6d2c45..0000000000 --- a/src/qml/doc/snippets/qml/listview/listview.qml +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![import] -import QtQuick 2.0 -//![import] - -Item { - -//![classdocs simple] -ListView { - width: 180; height: 200 - - model: ContactModel {} - delegate: Text { - text: name + ": " + number - } -} -//![classdocs simple] - -//![classdocs advanced] -Rectangle { - width: 180; height: 200 - - Component { - id: contactDelegate - Item { - width: 180; height: 40 - Column { - Text { text: '<b>Name:</b> ' + name } - Text { text: '<b>Number:</b> ' + number } - } - } - } - - ListView { - anchors.fill: parent - model: ContactModel {} - delegate: contactDelegate - highlight: Rectangle { color: "lightsteelblue"; radius: 5 } - focus: true - } -} -//![classdocs advanced] - -//![delayRemove] -Component { - id: delegate - Item { - ListView.onRemove: SequentialAnimation { - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad } - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } - } - } -} -//![delayRemove] - -//![highlightFollowsCurrentItem] -Component { - id: highlight - Rectangle { - width: 180; height: 40 - color: "lightsteelblue"; radius: 5 - y: list.currentItem.y - Behavior on y { - SpringAnimation { - spring: 3 - damping: 0.2 - } - } - } -} - -ListView { - id: list - width: 180; height: 200 - model: ContactModel {} - delegate: Text { text: name } - - highlight: highlight - highlightFollowsCurrentItem: false - focus: true -} -//![highlightFollowsCurrentItem] - -//![isCurrentItem] -ListView { - width: 180; height: 200 - - Component { - id: contactsDelegate - Rectangle { - id: wrapper - width: 180 - height: contactInfo.height - color: ListView.isCurrentItem ? "black" : "red" - Text { - id: contactInfo - text: name + ": " + number - color: wrapper.ListView.isCurrentItem ? "red" : "black" - } - } - } - - model: ContactModel {} - delegate: contactsDelegate - focus: true -} -//![isCurrentItem] - -} diff --git a/src/qml/doc/snippets/qml/loader/KeyReader.qml b/src/qml/doc/snippets/qml/loader/KeyReader.qml deleted file mode 100644 index ef15a01bb1..0000000000 --- a/src/qml/doc/snippets/qml/loader/KeyReader.qml +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Item { - Item { - focus: true - Keys.onPressed: { - console.log("Loaded item captured:", event.text); - event.accepted = true; - } - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/loader/MyItem.qml b/src/qml/doc/snippets/qml/loader/MyItem.qml deleted file mode 100644 index 2879e7ae23..0000000000 --- a/src/qml/doc/snippets/qml/loader/MyItem.qml +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - id: myItem - signal message(string msg) - - width: 100; height: 100 - - MouseArea { - anchors.fill: parent - onClicked: myItem.message("clicked!") - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/loader/connections.qml b/src/qml/doc/snippets/qml/loader/connections.qml deleted file mode 100644 index 82d770b2cb..0000000000 --- a/src/qml/doc/snippets/qml/loader/connections.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Item { - width: 100; height: 100 - - Loader { - id: myLoader - source: "MyItem.qml" - } - - Connections { - target: myLoader.item - onMessage: console.log(msg) - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/loader/focus.qml b/src/qml/doc/snippets/qml/loader/focus.qml deleted file mode 100644 index 4447c62905..0000000000 --- a/src/qml/doc/snippets/qml/loader/focus.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - width: 200; height: 200 - - Loader { - id: loader - focus: true - } - - MouseArea { - anchors.fill: parent - onClicked: loader.source = "KeyReader.qml" - } - - Keys.onPressed: { - console.log("Captured:", event.text); - } -} -//![0] - diff --git a/src/qml/doc/snippets/qml/loader/simple.qml b/src/qml/doc/snippets/qml/loader/simple.qml deleted file mode 100644 index a4408c2231..0000000000 --- a/src/qml/doc/snippets/qml/loader/simple.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Item { - width: 200; height: 200 - - Loader { id: pageLoader } - - MouseArea { - anchors.fill: parent - onClicked: pageLoader.source = "Page1.qml" - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/loader/sizeitem.qml b/src/qml/doc/snippets/qml/loader/sizeitem.qml deleted file mode 100644 index d673d82817..0000000000 --- a/src/qml/doc/snippets/qml/loader/sizeitem.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Item { - width: 200; height: 200 - - Loader { - // position the Loader in the center of the parent - anchors.centerIn: parent - sourceComponent: rect - } - - Component { - id: rect - Rectangle { - width: 50 - height: 50 - color: "red" - } - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/loader/sizeloader.qml b/src/qml/doc/snippets/qml/loader/sizeloader.qml deleted file mode 100644 index 551324598c..0000000000 --- a/src/qml/doc/snippets/qml/loader/sizeloader.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Item { - width: 200; height: 200 - - Loader { - // Explicitly set the size of the Loader to the parent item's size - anchors.fill: parent - sourceComponent: rect - } - - Component { - id: rect - Rectangle { - width: 50 - height: 50 - color: "red" - } - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/mousearea/mousearea.qml b/src/qml/doc/snippets/qml/mousearea/mousearea.qml deleted file mode 100644 index 1f35cd8b5f..0000000000 --- a/src/qml/doc/snippets/qml/mousearea/mousearea.qml +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//! [import] -import QtQuick 2.0 -//! [import] - -Rectangle { - width: childrenRect.width - height: childrenRect.height - - Row { - //! [intro] - Rectangle { - width: 100; height: 100 - color: "green" - - MouseArea { - anchors.fill: parent - onClicked: { parent.color = 'red' } - } - } - //! [intro] - - //! [intro-extended] - Rectangle { - width: 100; height: 100 - color: "green" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { - if (mouse.button == Qt.RightButton) - parent.color = 'blue'; - else - parent.color = 'red'; - } - } - } - //! [intro-extended] - - //! [drag] - Rectangle { - id: container - width: 600; height: 200 - - Rectangle { - id: rect - width: 50; height: 50 - color: "red" - opacity: (600.0 - rect.x) / 600 - - MouseArea { - anchors.fill: parent - drag.target: rect - drag.axis: Drag.XAxis - drag.minimumX: 0 - drag.maximumX: container.width - rect.width - } - } - } - //! [drag] - - //! [mousebuttons] - Text { - text: mouseArea.pressedButtons & Qt.RightButton ? "right" : "" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - MouseArea { - id: mouseArea - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - } - } - //! [mousebuttons] - - } -} diff --git a/src/qml/doc/snippets/qml/mousearea/mouseareadragfilter.qml b/src/qml/doc/snippets/qml/mousearea/mouseareadragfilter.qml deleted file mode 100644 index 922bfea636..0000000000 --- a/src/qml/doc/snippets/qml/mousearea/mouseareadragfilter.qml +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//! [dragfilter] -import QtQuick 2.0 - -Rectangle { - width: 480 - height: 320 - Rectangle { - x: 30; y: 30 - width: 300; height: 240 - color: "lightsteelblue" - - MouseArea { - anchors.fill: parent - drag.target: parent; - drag.axis: "XAxis" - drag.minimumX: 30 - drag.maximumX: 150 - drag.filterChildren: true - - Rectangle { - color: "yellow" - x: 50; y : 50 - width: 100; height: 100 - MouseArea { - anchors.fill: parent - onClicked: console.log("Clicked") - } - } - } - } -} -//! [dragfilter] diff --git a/src/qml/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml b/src/qml/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml deleted file mode 100644 index e4c2ffb039..0000000000 --- a/src/qml/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - width: 400; height: 400 - MultiPointTouchArea { - anchors.fill: parent - touchPoints: [ - TouchPoint { id: point1 }, - TouchPoint { id: point2 } - ] - } - - Rectangle { - width: 30; height: 30 - color: "green" - x: point1.x - y: point1.y - } - - Rectangle { - width: 30; height: 30 - color: "yellow" - x: point2.x - y: point2.y - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/parentanimation.qml b/src/qml/doc/snippets/qml/parentanimation.qml deleted file mode 100644 index 60429ed61c..0000000000 --- a/src/qml/doc/snippets/qml/parentanimation.qml +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Item { - width: 200; height: 100 - - Rectangle { - id: redRect - width: 100; height: 100 - color: "red" - } - - Rectangle { - id: blueRect - x: redRect.width - width: 50; height: 50 - color: "blue" - - states: State { - name: "reparented" - ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 } - } - - transitions: Transition { - ParentAnimation { - NumberAnimation { properties: "x,y"; duration: 1000 } - } - } - - MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" } - } -} -//![0] - diff --git a/src/qml/doc/snippets/qml/path/arcdirection.qml b/src/qml/doc/snippets/qml/path/arcdirection.qml deleted file mode 100644 index 7522649607..0000000000 --- a/src/qml/doc/snippets/qml/path/arcdirection.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 -//![0] -Path { - startX: 50; startY: 50 - - PathArc { - x: 150; y: 50 - radiusX: 75; radiusY: 50 - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/path/arcradius.qml b/src/qml/doc/snippets/qml/path/arcradius.qml deleted file mode 100644 index 04f2919270..0000000000 --- a/src/qml/doc/snippets/qml/path/arcradius.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 -//![0] -Path { - startX: 0; startY: 100 - - PathArc { - relativeX: 50; y: 100 - radiusX: 25; radiusY: 15 - } - PathArc { - relativeX: 50; y: 100 - radiusX: 25; radiusY: 25 - } - PathArc { - relativeX: 50; y: 100 - radiusX: 25; radiusY: 50 - } - PathArc { - relativeX: 50; y: 100 - radiusX: 50; radiusY: 100 - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/path/basicarc.qml b/src/qml/doc/snippets/qml/path/basicarc.qml deleted file mode 100644 index 562f2a0adf..0000000000 --- a/src/qml/doc/snippets/qml/path/basicarc.qml +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 -//![0] -Path { - startX: 100; startY: 0 - - PathArc { - x: 0; y: 100 - radiusX: 100; radiusY: 100 - useLargeArc: true - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/path/basiccurve.qml b/src/qml/doc/snippets/qml/path/basiccurve.qml deleted file mode 100644 index feb783cb01..0000000000 --- a/src/qml/doc/snippets/qml/path/basiccurve.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Canvas { - width: 400; height: 200 - - Path { - id: myPath - startX: 0; startY: 100 - - PathCurve { x: 75; y: 75 } - PathCurve { x: 200; y: 150 } - PathCurve { x: 325; y: 25 } - PathCurve { x: 400; y: 100 } - } - - onPaint: { - context.strokeStyle = Qt.rgba(.4,.6,.8); - context.path = myPath; - context.stroke(); - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/path/largearc.qml b/src/qml/doc/snippets/qml/path/largearc.qml deleted file mode 100644 index 69ce953c92..0000000000 --- a/src/qml/doc/snippets/qml/path/largearc.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 -//![0] -Path { - startX: 0; startY: 100 - PathArc { - x: 100; y: 200 - radiusX: 100; radiusY: 100 - direction: PathArc.Clockwise - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/pathinterpolator.qml b/src/qml/doc/snippets/qml/pathinterpolator.qml deleted file mode 100644 index 77cc664e27..0000000000 --- a/src/qml/doc/snippets/qml/pathinterpolator.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - width: 400 - height: 400 - - PathInterpolator { - id: motionPath - - path: Path { - startX: 0; startY: 0 - - PathCubic { - x: 350; y: 350 - - control1X: 350; control1Y: 0 - control2X: 0; control2Y: 350 - } - } - - NumberAnimation on progress { from: 0; to: 1; duration: 2000 } - } - - Rectangle { - width: 50; height: 50 - color: "green" - - //bind our attributes to follow the path as progress changes - x: motionPath.x - y: motionPath.y - rotation: motionPath.angle - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/pathview/ContactModel.qml b/src/qml/doc/snippets/qml/pathview/ContactModel.qml deleted file mode 100644 index d191413f27..0000000000 --- a/src/qml/doc/snippets/qml/pathview/ContactModel.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -ListModel { - ListElement { - name: "Bill Jones" - icon: "pics/qtlogo.png" - } - ListElement { - name: "Jane Doe" - icon: "pics/qtlogo.png" - } - ListElement { - name: "John Smith" - icon: "pics/qtlogo.png" - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/pathview/pathattributes.qml b/src/qml/doc/snippets/qml/pathview/pathattributes.qml deleted file mode 100644 index d555998650..0000000000 --- a/src/qml/doc/snippets/qml/pathview/pathattributes.qml +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//! [0] -import QtQuick 2.0 - -Rectangle { - width: 240; height: 200 - -//! [1] - Component { - id: delegate - Item { - width: 80; height: 80 - scale: PathView.iconScale - opacity: PathView.iconOpacity - Column { - Image { anchors.horizontalCenter: nameText.horizontalCenter; width: 64; height: 64; source: icon } - Text { id: nameText; text: name; font.pointSize: 16 } - } - } - } -//! [1] - -//! [2] - PathView { - anchors.fill: parent - model: ContactModel {} - delegate: delegate - path: Path { - startX: 120; startY: 100 - PathAttribute { name: "iconScale"; value: 1.0 } - PathAttribute { name: "iconOpacity"; value: 1.0 } - PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 } - PathAttribute { name: "iconScale"; value: 0.3 } - PathAttribute { name: "iconOpacity"; value: 0.5 } - PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 } - } - } -//! [2] -} -//! [0] diff --git a/src/qml/doc/snippets/qml/pathview/pathview.qml b/src/qml/doc/snippets/qml/pathview/pathview.qml deleted file mode 100644 index e5249d4cb6..0000000000 --- a/src/qml/doc/snippets/qml/pathview/pathview.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//! [0] -import QtQuick 2.0 - -Rectangle { - width: 240; height: 200 - -//! [1] - Component { - id: delegate - Column { - id: wrapper - Image { - anchors.horizontalCenter: nameText.horizontalCenter - width: 64; height: 64 - source: icon - } - Text { - id: nameText - text: name - font.pointSize: 16 - color: wrapper.PathView.isCurrentItem ? "red" : "black" - } - } - } -//! [1] - -//! [2] - PathView { - anchors.fill: parent - model: ContactModel {} - delegate: delegate - path: Path { - startX: 120; startY: 100 - PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 } - PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 } - } - } -//! [2] -} -//! [0] diff --git a/src/qml/doc/snippets/qml/propertyaction-sequential.qml b/src/qml/doc/snippets/qml/propertyaction-sequential.qml deleted file mode 100644 index 77d6ec194e..0000000000 --- a/src/qml/doc/snippets/qml/propertyaction-sequential.qml +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -Row { - - Item { - width: 400; height: 400 - - Rectangle { - id: rect - width: 200; height: 100 - color: "red" - - states: State { - name: "rotated" - PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight } - } - - //! [sequential] - transitions: Transition { - SequentialAnimation { - PropertyAction { target: rect; property: "transformOrigin" } - RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise } - } - } - //! [sequential] - - MouseArea { - anchors.fill: parent - onClicked: rect.state = "rotated" - } - } - } -} diff --git a/src/qml/doc/snippets/qml/propertyaction.qml b/src/qml/doc/snippets/qml/propertyaction.qml deleted file mode 100644 index 5ddef30177..0000000000 --- a/src/qml/doc/snippets/qml/propertyaction.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -Row { - - //![transition] - Item { - width: 400; height: 400 - - Rectangle { - id: rect - width: 200; height: 100 - color: "red" - - states: State { - name: "rotated" - PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight } - } - - transitions: Transition { - RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise } - } - - MouseArea { - anchors.fill: parent - onClicked: rect.state = "rotated" - } - } - } - //![transition] - - Item { - width: 300; height: 300 - - Image { id: img; source: "pics/qt.png" } - - //![standalone] - SequentialAnimation { - PropertyAction { target: img; property: "smooth"; value: "true" } - NumberAnimation { target: img; property: "width"; to: 300; duration: 1000 } - PropertyAction { target: img; property: "smooth"; value: "false" } - } - //![standalone] - } -} diff --git a/src/qml/doc/snippets/qml/propertyanimation.qml b/src/qml/doc/snippets/qml/propertyanimation.qml deleted file mode 100644 index b5781af94a..0000000000 --- a/src/qml/doc/snippets/qml/propertyanimation.qml +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Row { - -//![transition] -Rectangle { - id: rect - width: 100; height: 100 - color: "red" - - //! [single state] - states: State { - name: "moved" - PropertyChanges { target: rect; x: 50 } - } - //! [single state] - - transitions: Transition { - PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } - } -} -//![transition] - -//![behavior] -Rectangle { - width: 100; height: 100 - color: "red" - - Behavior on x { PropertyAnimation {} } - - MouseArea { anchors.fill: parent; onClicked: parent.x = 50 } -} -//![behavior] - -//![propertyvaluesource] -Rectangle { - width: 100; height: 100 - color: "red" - - SequentialAnimation on x { - loops: Animation.Infinite - PropertyAnimation { to: 50 } - PropertyAnimation { to: 0 } - } -} -//![propertyvaluesource] - - //![standalone] - Rectangle { - id: theRect - width: 100; height: 100 - color: "red" - - // this is a standalone animation, it's not running by default - PropertyAnimation { id: animation; target: theRect; property: "width"; to: 30; duration: 500 } - - MouseArea { anchors.fill: parent; onClicked: animation.running = true } - } - //![standalone] -} diff --git a/src/qml/doc/snippets/qml/propertychanges.qml b/src/qml/doc/snippets/qml/propertychanges.qml deleted file mode 100644 index 3be13f7861..0000000000 --- a/src/qml/doc/snippets/qml/propertychanges.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![import] -import QtQuick 2.0 -//![import] - -Column { - -//![0] -Item { - id: container - width: 300; height: 300 - - Rectangle { - id: rect - width: 100; height: 100 - color: "red" - - MouseArea { - id: mouseArea - anchors.fill: parent - } - - states: State { - name: "resized"; when: mouseArea.pressed - PropertyChanges { target: rect; color: "blue"; height: container.height } - } - } -} -//![0] - -//![reset] -Rectangle { - width: 300; height: 200 - - Text { - id: myText - width: 50 - wrapMode: Text.WordWrap - text: "a text string that is longer than 50 pixels" - - states: State { - name: "widerText" - PropertyChanges { target: myText; width: undefined } - } - } - - MouseArea { - anchors.fill: parent - onClicked: myText.state = "widerText" - } -} -//![reset] -} diff --git a/src/qml/doc/snippets/qml/parallelanimation.qml b/src/qml/doc/snippets/qml/qtBinding.1.qml index 20f6ccc1df..acec88a47f 100644 --- a/src/qml/doc/snippets/qml/parallelanimation.qml +++ b/src/qml/doc/snippets/qml/qtBinding.1.qml @@ -38,19 +38,18 @@ ** ****************************************************************************/ -//![0] import QtQuick 2.0 -Rectangle { - id: rect - width: 100; height: 100 - color: "red" +//![0] +Item { + property bool someCondition: true + property int edgePosition - ParallelAnimation { - running: true - NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 } - NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 } + Component.onCompleted: { + if (someCondition == true) { + // bind to the result of the binding expression passed to Qt.binding() + edgePosition = Qt.binding(function() { return x + width }) + } } } //![0] - diff --git a/src/qml/doc/snippets/qml/anchoranimation.qml b/src/qml/doc/snippets/qml/qtBinding.2.qml index 8f0603fab8..9b78bc395a 100644 --- a/src/qml/doc/snippets/qml/anchoranimation.qml +++ b/src/qml/doc/snippets/qml/qtBinding.2.qml @@ -38,29 +38,21 @@ ** ****************************************************************************/ -//![0] import QtQuick 2.0 +//![0] Item { - id: container - width: 200; height: 200 + id: root + property string dynamicText: "Root text" - Rectangle { - id: myRect - width: 100; height: 100 - color: "red" - } + Component.onCompleted: { + var c = Qt.createComponent("DynamicText.qml") - states: State { - name: "reanchored" - AnchorChanges { target: myRect; anchors.right: container.right } - } + var obj1 = c.createObject(root, { 'text': Qt.binding(function() { return dynamicText + ' extra text' }) }) + root.dynamicText = "Modified root text" - transitions: Transition { - // smoothly reanchor myRect and move into new position - AnchorAnimation { duration: 1000 } + var obj2 = c.createObject(root, { 'text': Qt.binding(function() { return this.dynamicText + ' extra text' }) }) + obj2.dynamicText = "Modified text element text" } - - Component.onCompleted: container.state = "reanchored" } //![0] diff --git a/src/qml/doc/snippets/qml/parentchange.qml b/src/qml/doc/snippets/qml/qtBinding.3.qml index 4ae4476e13..a27914cc15 100644 --- a/src/qml/doc/snippets/qml/parentchange.qml +++ b/src/qml/doc/snippets/qml/qtBinding.3.qml @@ -37,31 +37,27 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -//![0] + import QtQuick 2.0 +//![0] Item { - width: 200; height: 100 + id: root + property string dynamicText: "Root text" - Rectangle { - id: redRect - width: 100; height: 100 - color: "red" + Loader { + id: loaderOne + onLoaded: root.dynamicText = "Modified root text" } - Rectangle { - id: blueRect - x: redRect.width - width: 50; height: 50 - color: "blue" - - states: State { - name: "reparented" - ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 } - } + Loader { + id: loaderTwo + onLoaded: item.dynamicText = "Modified dynamic text" + } - MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" } + Component.onCompleted: { + loaderOne.setSource("DynamicText.qml", { 'text': Qt.binding(function() { return dynamicText + ' extra text' }) }) + loaderTwo.setSource("DynamicText.qml", { 'text': Qt.binding(function() { return this.dynamicText + ' extra text' }) }) } } //![0] - diff --git a/src/qml/doc/snippets/qml/rectangle/rect-border-width.qml b/src/qml/doc/snippets/qml/qtBinding.4.qml index 6dd4dbe739..0155957a59 100644 --- a/src/qml/doc/snippets/qml/rectangle/rect-border-width.qml +++ b/src/qml/doc/snippets/qml/qtBinding.4.qml @@ -41,19 +41,14 @@ import QtQuick 2.0 //![0] -Rectangle { - width: 100; height: 100 - color: "lightblue" +Item { + width: 50 + property var storedBindings: [ Qt.binding(function() { return x + width }) ] // stored + property int a: Qt.binding(function() { return x + width }) // error! + property int b - Rectangle { - anchors.fill: parent - anchors.margins: 10 - clip: true - - Rectangle { - anchors.fill: parent - border.width: 1 - } + Component.onCompleted: { + b = storedBindings[0] // causes binding assignment } } //![0] diff --git a/src/qml/doc/snippets/qml/qtbinding/resources/example.qrc b/src/qml/doc/snippets/qml/qtbinding/resources/example.qrc new file mode 100644 index 0000000000..5e4941512b --- /dev/null +++ b/src/qml/doc/snippets/qml/qtbinding/resources/example.qrc @@ -0,0 +1,10 @@ +<!DOCTYPE RCC> +<RCC version="1.0"> + +<qresource prefix="/"> + <file>main.qml</file> + <file>images/background.png</file> +</qresource> + +</RCC> + diff --git a/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro b/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro new file mode 100644 index 0000000000..5aee288a6e --- /dev/null +++ b/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro @@ -0,0 +1,4 @@ +QT += qml + +SOURCES += main.cpp +RESOURCES += example.qrc diff --git a/src/qml/doc/snippets/qml/rectangle/rectangle-colors.qml b/src/qml/doc/snippets/qml/rectangle/rectangle-colors.qml deleted file mode 100644 index 70f7a203f4..0000000000 --- a/src/qml/doc/snippets/qml/rectangle/rectangle-colors.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - width: 100; height: 200 - -Item { - x: 10; y: 10 - width: 80; height: 180 - -//! [rectangles] -Rectangle { - color: "#00B000" - width: 80; height: 80 -} - -Rectangle { - color: "steelblue" - y: 100; width: 80; height: 80 -} -//! [rectangles] -} -} diff --git a/src/qml/doc/snippets/qml/rectangle/rectangle-gradient.qml b/src/qml/doc/snippets/qml/rectangle/rectangle-gradient.qml deleted file mode 100644 index e8146a6467..0000000000 --- a/src/qml/doc/snippets/qml/rectangle/rectangle-gradient.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - width: 100; height: 300 - -Item { - x: 10; y: 10 - width: 80; height: 280 - -//! [rectangles] -Rectangle { - y: 0; width: 80; height: 80 - color: "lightsteelblue" -} - -Rectangle { - y: 100; width: 80; height: 80 - gradient: Gradient { - GradientStop { position: 0.0; color: "lightsteelblue" } - GradientStop { position: 1.0; color: "blue" } - } -} - -Rectangle { - y: 200; width: 80; height: 80 - rotation: 90 - gradient: Gradient { - GradientStop { position: 0.0; color: "lightsteelblue" } - GradientStop { position: 1.0; color: "blue" } - } -} -//! [rectangles] -} -} diff --git a/src/qml/doc/snippets/qml/rectangle/rectangle.qml b/src/qml/doc/snippets/qml/rectangle/rectangle.qml deleted file mode 100644 index c315a27da0..0000000000 --- a/src/qml/doc/snippets/qml/rectangle/rectangle.qml +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 2.0 - -Rectangle { - width: 100 - height: 100 - color: "red" - border.color: "black" - border.width: 5 - radius: 10 -} -//! [document] diff --git a/src/qml/doc/snippets/qml/repeaters/repeater.qml b/src/qml/doc/snippets/qml/repeaters/repeater.qml deleted file mode 100644 index 856b038a04..0000000000 --- a/src/qml/doc/snippets/qml/repeaters/repeater.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//! [import] -import QtQuick 2.0 -//! [import] - -Row { - -//! [simple] -Row { - Repeater { - model: 3 - Rectangle { - width: 100; height: 40 - border.width: 1 - color: "yellow" - } - } -} -//! [simple] - -//! [index] -Column { - Repeater { - model: 10 - Text { text: "I'm item " + index } - } -} -//! [index] - -//! [modeldata] -Column { - Repeater { - model: ["apples", "oranges", "pears"] - Text { text: "Data: " + modelData } - } -} -//! [modeldata] - -//! [layout] -Row { - Rectangle { width: 10; height: 20; color: "red" } - Repeater { - model: 10 - Rectangle { width: 20; height: 20; radius: 10; color: "green" } - } - Rectangle { width: 10; height: 20; color: "blue" } -} -//! [layout] - -} diff --git a/src/qml/doc/snippets/qml/righttoleft.qml b/src/qml/doc/snippets/qml/righttoleft.qml deleted file mode 100644 index 0566be2f67..0000000000 --- a/src/qml/doc/snippets/qml/righttoleft.qml +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "righttoleft" - -Column { - width: 200 -//![0] -// automatically aligned to the left -Text { - text: "Phone" - width: 200 -} - -// automatically aligned to the right -Text { - text: "خامل" - width: 200 -} - -// aligned to the left -Text { - text: "خامل" - horizontalAlignment: Text.AlignLeft - width: 200 -} - -// aligned to the right -Text { - text: "خامل" - horizontalAlignment: Text.AlignLeft - LayoutMirroring.enabled: true - width: 200 -} -//![0] - -//![1] -// by default child items are positioned from left to right -Row { - Child {} - Child {} -} - -// position child items from right to left -Row { - layoutDirection: Qt.RightToLeft - Child {} - Child {} -} - -// position child items from left to right -Row { - LayoutMirroring.enabled: true - layoutDirection: Qt.RightToLeft - Child {} - Child {} -} -//![1] - -//![2] -Item { - height: 50; width: 150 - - LayoutMirroring.enabled: true - anchors.left: parent.left // anchor left becomes right - - Row { - // items flow from left to right (as per default) - Child {} - Child {} - Child {} - } -} -//![2] - -//![3] -Item { - height: 50; width: 150 - - LayoutMirroring.enabled: true - LayoutMirroring.childrenInherit: true - anchors.left: parent.left // anchor left becomes right - - Row { - // setting childrenInherit in the parent causes these - // items to flow from right to left instead - Child {} - Child {} - Child {} - } -} -//![3] - -//![4] -Rectangle { - color: "black" - height: 50; width: 50 - x: mirror(10) - function mirror(value) { - return LayoutMirroring.enabled ? (parent.width - width - value) : value; - } -} -//![4] - -//![5] -Image { - source: "arrow.png" - mirror: true -} -//![5] -} diff --git a/src/qml/doc/snippets/qml/righttoleft/Child.qml b/src/qml/doc/snippets/qml/righttoleft/Child.qml deleted file mode 100644 index 50068540cb..0000000000 --- a/src/qml/doc/snippets/qml/righttoleft/Child.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - width: 50; height: 50 - color: "black" - Text { - color: "white" - text: String.fromCharCode(65 + Math.floor(26*Math.random())) - anchors.centerIn: parent - } -} diff --git a/src/qml/doc/snippets/qml/rotation.qml b/src/qml/doc/snippets/qml/rotation.qml deleted file mode 100644 index c7f9df3a9b..0000000000 --- a/src/qml/doc/snippets/qml/rotation.qml +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//! [0] -import QtQuick 2.0 - -Row { - x: 10; y: 10 - spacing: 10 - - Image { source: "pics/qt.png" } - Image { - source: "pics/qt.png" - transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 } - smooth: true - } - Image { - source: "pics/qt.png" - transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 } - smooth: true - } - Image { - source: "pics/qt.png" - transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 } - smooth: true - } - Image { - source: "pics/qt.png" - transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 } - smooth: true - } -} -//! [0] diff --git a/src/qml/doc/snippets/qml/rotationanimation.qml b/src/qml/doc/snippets/qml/rotationanimation.qml deleted file mode 100644 index caa1ce8207..0000000000 --- a/src/qml/doc/snippets/qml/rotationanimation.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Item { - width: 300; height: 300 - - Rectangle { - id: rect - width: 150; height: 100; anchors.centerIn: parent - color: "red" - smooth: true - - states: State { - name: "rotated" - PropertyChanges { target: rect; rotation: 180 } - } - - transitions: Transition { - RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise } - } - } - - MouseArea { anchors.fill: parent; onClicked: rect.state = "rotated" } -} -//![0] - diff --git a/src/qml/doc/snippets/qml/row/row.qml b/src/qml/doc/snippets/qml/row/row.qml deleted file mode 100644 index 465baa577b..0000000000 --- a/src/qml/doc/snippets/qml/row/row.qml +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 2.0 - -Row { - spacing: 2 - Rectangle { color: "red"; width: 50; height: 50 } - Rectangle { color: "green"; width: 20; height: 50 } - Rectangle { color: "blue"; width: 50; height: 20 } -} -//! [document] diff --git a/src/qml/doc/snippets/qml/sequentialanimation.qml b/src/qml/doc/snippets/qml/sequentialanimation.qml deleted file mode 100644 index 73923e4ea0..0000000000 --- a/src/qml/doc/snippets/qml/sequentialanimation.qml +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Rectangle { - id: rect - width: 100; height: 100 - color: "red" - - SequentialAnimation { - running: true - NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 } - NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 } - } -} -//![0] - diff --git a/src/qml/doc/snippets/qml/smoothedanimation.qml b/src/qml/doc/snippets/qml/smoothedanimation.qml deleted file mode 100644 index ba6f505976..0000000000 --- a/src/qml/doc/snippets/qml/smoothedanimation.qml +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Rectangle { - width: 800; height: 600 - color: "blue" - - Rectangle { - width: 60; height: 60 - x: rect1.x - 5; y: rect1.y - 5 - color: "green" - - Behavior on x { SmoothedAnimation { velocity: 200 } } - Behavior on y { SmoothedAnimation { velocity: 200 } } - } - - Rectangle { - id: rect1 - width: 50; height: 50 - color: "red" - } - - focus: true - Keys.onRightPressed: rect1.x = rect1.x + 100 - Keys.onLeftPressed: rect1.x = rect1.x - 100 - Keys.onUpPressed: rect1.y = rect1.y - 100 - Keys.onDownPressed: rect1.y = rect1.y + 100 -} -//![0] diff --git a/src/qml/doc/snippets/qml/springanimation.qml b/src/qml/doc/snippets/qml/springanimation.qml deleted file mode 100644 index e04c483405..0000000000 --- a/src/qml/doc/snippets/qml/springanimation.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -//![0] -import QtQuick 2.0 - -Item { - width: 300; height: 300 - - Rectangle { - id: rect - width: 50; height: 50 - color: "red" - - Behavior on x { SpringAnimation { spring: 2; damping: 0.2 } } - Behavior on y { SpringAnimation { spring: 2; damping: 0.2 } } - } - - MouseArea { - anchors.fill: parent - onClicked: { - rect.x = mouse.x - rect.width/2 - rect.y = mouse.y - rect.height/2 - } - } -} -//![0] - diff --git a/src/qml/doc/snippets/qml/state-when.qml b/src/qml/doc/snippets/qml/state-when.qml deleted file mode 100644 index de9fb39cef..0000000000 --- a/src/qml/doc/snippets/qml/state-when.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 -//![0] -Rectangle { - id: myRect - width: 100; height: 100 - color: "red" - - MouseArea { id: mouseArea; anchors.fill: parent } - - states: State { - name: "hidden"; when: mouseArea.pressed - PropertyChanges { target: myRect; opacity: 0 } - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/state.qml b/src/qml/doc/snippets/qml/state.qml deleted file mode 100644 index 5948cba770..0000000000 --- a/src/qml/doc/snippets/qml/state.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - id: myRect - width: 100; height: 100 - color: "black" - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: myRect.state == 'clicked' ? myRect.state = "" : myRect.state = 'clicked'; - } - - states: [ - State { - name: "clicked" - PropertyChanges { target: myRect; color: "red" } - } - ] -} -//![0] diff --git a/src/qml/doc/snippets/qml/states/statechangescript.qml b/src/qml/doc/snippets/qml/states/statechangescript.qml deleted file mode 100644 index 262938fc9c..0000000000 --- a/src/qml/doc/snippets/qml/states/statechangescript.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { -//! [state and transition] -State { - name: "state1" - StateChangeScript { - name: "myScript" - script: doStateStuff(); - } - // ... -} -// ... -Transition { - to: "state1" - SequentialAnimation { - NumberAnimation { /* ... */ } - ScriptAction { scriptName: "myScript" } - NumberAnimation { /* ... */ } - } -} -//! [state and transition] -} diff --git a/src/qml/doc/snippets/qml/systempalette.qml b/src/qml/doc/snippets/qml/systempalette.qml deleted file mode 100644 index 4cb42dee93..0000000000 --- a/src/qml/doc/snippets/qml/systempalette.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } - - width: 640; height: 480 - color: myPalette.window - - Text { - anchors.fill: parent - text: "Hello!"; color: myPalette.windowText - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/text/onLinkActivated.qml b/src/qml/doc/snippets/qml/text/onLinkActivated.qml deleted file mode 100644 index 03641d989e..0000000000 --- a/src/qml/doc/snippets/qml/text/onLinkActivated.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtQml module 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -Rectangle { - width: 700; height: 400 - -//![0] - Text { - textFormat: Text.RichText - text: "The main website is at <a href=\"http://qt.nokia.com\">Nokia Qt DF</a>." - onLinkActivated: console.log(link + " link activated") - } -//![0] - -} - diff --git a/src/qml/doc/snippets/qml/transition-from-to-modified.qml b/src/qml/doc/snippets/qml/transition-from-to-modified.qml deleted file mode 100644 index 184e95afe2..0000000000 --- a/src/qml/doc/snippets/qml/transition-from-to-modified.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -Rectangle { - id: rect - width: 100; height: 100 - color: "red" - - MouseArea { id: mouseArea; anchors.fill: parent } - - states: State { - name: "brighter"; when: mouseArea.pressed - PropertyChanges { target: rect; color: "yellow" } - } - - //! [modified transition] - transitions: Transition { - to: "brighter" - ColorAnimation { duration: 1000 } - } - //! [modified transition] -} diff --git a/src/qml/doc/snippets/qml/transition-from-to.qml b/src/qml/doc/snippets/qml/transition-from-to.qml deleted file mode 100644 index c876f5cb9c..0000000000 --- a/src/qml/doc/snippets/qml/transition-from-to.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -//![0] -Rectangle { - id: rect - width: 100; height: 100 - color: "red" - - MouseArea { id: mouseArea; anchors.fill: parent } - - states: State { - name: "brighter"; when: mouseArea.pressed - PropertyChanges { target: rect; color: "yellow" } - } - - transitions: Transition { - ColorAnimation { duration: 1000 } - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/transition-reversible.qml b/src/qml/doc/snippets/qml/transition-reversible.qml deleted file mode 100644 index 4f7ae83468..0000000000 --- a/src/qml/doc/snippets/qml/transition-reversible.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -import QtQuick 2.0 - -//![0] -Rectangle { - id: rect - width: 100; height: 100 - color: "red" - - MouseArea { id: mouseArea; anchors.fill: parent } - - states: State { - name: "brighter" - when: mouseArea.pressed - PropertyChanges { target: rect; color: "yellow"; x: 50 } - } - - //! [sequential animations] - transitions: Transition { - SequentialAnimation { - PropertyAnimation { property: "x"; duration: 1000 } - ColorAnimation { duration: 1000 } - } - } - //! [sequential animations] -} -//![0] - diff --git a/src/qml/doc/snippets/qml/transition.qml b/src/qml/doc/snippets/qml/transition.qml deleted file mode 100644 index 614c5d364f..0000000000 --- a/src/qml/doc/snippets/qml/transition.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - id: rect - width: 100; height: 100 - color: "red" - - MouseArea { - id: mouseArea - anchors.fill: parent - } - - states: State { - name: "moved"; when: mouseArea.pressed - PropertyChanges { target: rect; x: 50; y: 50 } - } - - transitions: Transition { - NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } - } -} -//![0] - diff --git a/src/qml/doc/snippets/qml/transitions-list.qml b/src/qml/doc/snippets/qml/transitions-list.qml deleted file mode 100644 index f2ba768559..0000000000 --- a/src/qml/doc/snippets/qml/transitions-list.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - width: 150; height: 250 - - Rectangle { - id: stopLight - x: 25; y: 15; width: 100; height: 100 - } - Rectangle { - id: goLight - x: 25; y: 135; width: 100; height: 100 - } - - states: [ - State { - name: "stop" - PropertyChanges { target: stopLight; color: "red" } - PropertyChanges { target: goLight; color: "black" } - }, - State { - name: "go" - PropertyChanges { target: stopLight; color: "black" } - PropertyChanges { target: goLight; color: "green" } - } - ] - - state: "stop" - - MouseArea { - anchors.fill: parent - onClicked: parent.state == "stop" ? - parent.state = "go" : parent.state = "stop" - } - - //! [list of transitions] - transitions: [ - Transition { - from: "stop"; to: "go" - PropertyAnimation { target: stopLight - properties: "color"; duration: 1000 } - }, - Transition { - from: "go"; to: "stop" - PropertyAnimation { target: goLight - properties: "color"; duration: 1000 } - } ] - //! [list of transitions] -} diff --git a/src/qml/doc/snippets/qml/visualdatagroup.qml b/src/qml/doc/snippets/qml/visualdatagroup.qml deleted file mode 100644 index 46ac9a3d7a..0000000000 --- a/src/qml/doc/snippets/qml/visualdatagroup.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - width: 200; height: 100 - - VisualDataModel { - id: visualModel - model: ListModel { - ListElement { name: "Apple" } - ListElement { name: "Orange" } - } - - groups: [ - VisualDataGroup { name: "selected" } - ] - - delegate: Rectangle { - id: item - height: 25 - width: 200 - Text { - text: { - var text = "Name: " + name - if (item.VisualDataModel.inSelected) - text += " (" + item.VisualDataModel.selectedIndex + ")" - return text; - } - } - MouseArea { - anchors.fill: parent - onClicked: item.VisualDataModel.inSelected = !item.VisualDataModel.inSelected - } - } - } - - ListView { - anchors.fill: parent - model: visualModel - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/visualdatamodel.qml b/src/qml/doc/snippets/qml/visualdatamodel.qml deleted file mode 100644 index 87b836e224..0000000000 --- a/src/qml/doc/snippets/qml/visualdatamodel.qml +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -Rectangle { - width: 200; height: 100 - - VisualDataModel { - id: visualModel - model: ListModel { - ListElement { name: "Apple" } - ListElement { name: "Orange" } - } - delegate: Rectangle { - height: 25 - width: 100 - Text { text: "Name: " + name} - } - } - - ListView { - anchors.fill: parent - model: visualModel - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/visualdatamodel_rootindex/main.cpp b/src/qml/doc/snippets/qml/visualdatamodel_rootindex/main.cpp deleted file mode 100644 index 4468d06db4..0000000000 --- a/src/qml/doc/snippets/qml/visualdatamodel_rootindex/main.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtQml module 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$ -** -****************************************************************************/ -#include <QQuickView> -#include <QQmlContext> - -#include <QApplication> -#include <QDirModel> - -//![0] -int main(int argc, char ** argv) -{ - QApplication app(argc, argv); - - QQuickView view; - - QDirModel model; - view.rootContext()->setContextProperty("dirModel", &model); - - view.setSource(QUrl::fromLocalFile("view.qml")); - view.show(); - - return app.exec(); -} -//![0] - diff --git a/src/qml/doc/snippets/qml/visualdatamodel_rootindex/view.qml b/src/qml/doc/snippets/qml/visualdatamodel_rootindex/view.qml deleted file mode 100644 index 24d6b47f8d..0000000000 --- a/src/qml/doc/snippets/qml/visualdatamodel_rootindex/view.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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$ -** -****************************************************************************/ -//![0] -import QtQuick 2.0 - -ListView { - id: view - width: 300 - height: 400 - - model: VisualDataModel { - model: dirModel - - delegate: Rectangle { - width: 200; height: 25 - Text { text: filePath } - - MouseArea { - anchors.fill: parent - onClicked: { - if (model.hasModelChildren) - view.model.rootIndex = view.model.modelIndex(index) - } - } - } - } -} -//![0] diff --git a/src/qml/doc/snippets/qml/workerscript/script.js b/src/qml/doc/snippets/qml/workerscript/script.js new file mode 100644 index 0000000000..f55dee3507 --- /dev/null +++ b/src/qml/doc/snippets/qml/workerscript/script.js @@ -0,0 +1,4 @@ +WorkerScript.onMessage = function(message) { + // ... long-running operations and calculations are done here + WorkerScript.sendMessage({ 'reply': 'Mouse is at ' + message.x + ',' + message.y }) +} diff --git a/src/qml/doc/snippets/qml/workerscript.qml b/src/qml/doc/snippets/qml/workerscript/workerscript.qml index 6af6b47766..6af6b47766 100644 --- a/src/qml/doc/snippets/qml/workerscript.qml +++ b/src/qml/doc/snippets/qml/workerscript/workerscript.qml diff --git a/src/qml/doc/src/bindings/c++models.qdoc b/src/qml/doc/src/bindings/c++models.qdoc index e2f2f32b5c..3db813b857 100644 --- a/src/qml/doc/src/bindings/c++models.qdoc +++ b/src/qml/doc/src/bindings/c++models.qdoc @@ -46,14 +46,14 @@ models. Here is a ListView with a delegate that references its model item's value using the \c modelData role: - \snippet examples/declarative/modelviews/stringlistmodel/view.qml 0 + \snippet examples/quick/modelviews/stringlistmodel/view.qml 0 A Qt application can load this QML document and set the value of \c myModel to a QStringList: - \snippet examples/declarative/modelviews/stringlistmodel/main.cpp 0 + \snippet examples/quick/modelviews/stringlistmodel/main.cpp 0 - The complete example is available in Qt's \l {declarative/modelviews/stringlistmodel}{examples/declarative/modelviews/stringlistmodel} directory. + The complete example is available in Qt's \l {declarative/modelviews/stringlistmodel}{examples/quick/modelviews/stringlistmodel} directory. \b{Note:} There is no way for the view to know that the contents of a QStringList have changed. If the QStringList changes, it will be necessary to reset @@ -69,11 +69,11 @@ models. Q_PROPERTY values that will be accessible as named roles when a QList<DataObject*> is exposed to QML: - \snippet examples/declarative/modelviews/objectlistmodel/dataobject.h 0 + \snippet examples/quick/modelviews/objectlistmodel/dataobject.h 0 \dots 4 - \snippet examples/declarative/modelviews/objectlistmodel/dataobject.h 1 + \snippet examples/quick/modelviews/objectlistmodel/dataobject.h 1 \codeline - \snippet examples/declarative/modelviews/objectlistmodel/main.cpp 0 + \snippet examples/quick/modelviews/objectlistmodel/main.cpp 0 \dots The QObject* is available as the \c modelData property. As a convenience, @@ -81,14 +81,14 @@ models. delegate's context. Here, \c view.qml references the \c DataModel properties in the ListView delegate: - \snippet examples/declarative/modelviews/objectlistmodel/view.qml 0 + \snippet examples/quick/modelviews/objectlistmodel/view.qml 0 Note the use of the fully qualified access to the \c color property. The properties of the object are not replicated in the \c model object, since they are easily available via the \c modelData object. - The complete example is available in Qt's \l {declarative/modelviews/objectlistmodel}{examples/declarative/modelviews/objectlistmodel} directory. + The complete example is available in Qt's \l {declarative/modelviews/objectlistmodel}{examples/quick/modelviews/objectlistmodel} directory. Note: There is no way for the view to know that the contents of a QList have changed. If the QList changes, it will be necessary to reset @@ -121,21 +121,21 @@ models. that has \e type and \e size roles. It calls QAbstractItemModel::setRoleNames() to set the role names for accessing the properties via QML: - \snippet examples/declarative/modelviews/abstractitemmodel/model.h 0 + \snippet examples/quick/modelviews/abstractitemmodel/model.h 0 \dots - \snippet examples/declarative/modelviews/abstractitemmodel/model.h 1 + \snippet examples/quick/modelviews/abstractitemmodel/model.h 1 \dots - \snippet examples/declarative/modelviews/abstractitemmodel/model.h 2 + \snippet examples/quick/modelviews/abstractitemmodel/model.h 2 \codeline - \snippet examples/declarative/modelviews/abstractitemmodel/model.cpp 0 + \snippet examples/quick/modelviews/abstractitemmodel/model.cpp 0 \codeline - \snippet examples/declarative/modelviews/abstractitemmodel/main.cpp 0 + \snippet examples/quick/modelviews/abstractitemmodel/main.cpp 0 \dots This model is displayed by a ListView delegate that accesses the \e type and \e size roles: - \snippet examples/declarative/modelviews/abstractitemmodel/view.qml 0 + \snippet examples/quick/modelviews/abstractitemmodel/view.qml 0 QML views are automatically updated when the model changes. Remember the model must follow the standard rules for model changes and notify the view when @@ -143,7 +143,7 @@ models. QAbstractItemModel::beginInsertRows(), etc. See the \l {Model subclassing reference} for more information. - The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/declarative/modelviews/abstractitemmodel} directory. + The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/quick/modelviews/abstractitemmodel} directory. QAbstractItemModel presents a hierarchy of tables, but the views currently provided by QML can only display list data. diff --git a/src/qml/doc/src/bindings/properties-methods-signals.qdoc b/src/qml/doc/src/bindings/properties-methods-signals.qdoc index 2aa11e9a50..b88324e567 100644 --- a/src/qml/doc/src/bindings/properties-methods-signals.qdoc +++ b/src/qml/doc/src/bindings/properties-methods-signals.qdoc @@ -120,15 +120,15 @@ Q_PROPERTY(int size READ size CONSTANT) <group>.<property> notation. For example, shoe.color is the way to access the \c color property in the \c shoe property group . - \snippet examples/declarative/cppextensions/referenceexamples/grouped/example.qml ungrouped + \snippet examples/qml/cppextensions/referenceexamples/grouped/example.qml ungrouped Alternatively, the group can be accessed as a set. - \snippet examples/declarative/cppextensions/referenceexamples/grouped/example.qml grouped + \snippet examples/qml/cppextensions/referenceexamples/grouped/example.qml grouped A grouped property block is implemented as a read-only object property. The \c shoe property shown is declared like this: - \snippet examples/declarative/cppextensions/referenceexamples/grouped/person.h 1 + \snippet examples/qml/cppextensions/referenceexamples/grouped/person.h 1 The \c ShoeDescription type declares the properties available to the grouped property block - in this case the \c size, \c color, \c brand and \c price properties. @@ -150,7 +150,7 @@ Q_PROPERTY(int size READ size CONSTANT) attaching type are those that become available for use as attached properties. - \snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml 1 + \snippet examples/qml/cppextensions/referenceexamples/attached/example.qml 1 The \c BirthdayParty is called the attaching type and the \c Boy instance the attachee object instance. The property \c rsvp is the @@ -171,12 +171,12 @@ Q_PROPERTY(int size READ size CONSTANT) The \l {Extending QML - Attached Properties Example}{Birthday} class has \c BirthdayPartyAttached attached properties. - \snippet examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h static attached + \snippet examples/qml/cppextensions/referenceexamples/attached/birthdayparty.h static attached The QML_DECLARE_TYPEINFO() macro can notify the runtime that the type has attached properties with the QML_HAS_ATTACHED_PROPERTIES argument. - \snippet examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h declare attached + \snippet examples/qml/cppextensions/referenceexamples/attached/birthdayparty.h declare attached The qmlAttachedProperties method will be called at most once for each attachee object instance. The QML engine will cache the returned instance @@ -186,9 +186,9 @@ Q_PROPERTY(int size READ size CONSTANT) A common usage scenario is for a type to enhance the properties available to its children in order to gather instance specific data. - \snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml begin - \snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml rsvp - \snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml end + \snippet examples/qml/cppextensions/referenceexamples/attached/example.qml begin + \snippet examples/qml/cppextensions/referenceexamples/attached/example.qml rsvp + \snippet examples/qml/cppextensions/referenceexamples/attached/example.qml end However, as a QML type cannot limit the instances to which the attachment object must attach, the following is also allowed, even though adding a @@ -218,7 +218,7 @@ Q_PROPERTY(int size READ size CONSTANT) The \c rsvp properties of each guest in the \c Birthday party is accessible through the \c qmlAttachedPropertiesObject function. - \snippet examples/declarative/cppextensions/referenceexamples/attached/main.cpp query rsvp + \snippet examples/qml/cppextensions/referenceexamples/attached/main.cpp query rsvp The \l {Extending QML - Attached Properties Example}{Attached Properties Example} @@ -237,7 +237,7 @@ Q_PROPERTY(int size READ size CONSTANT) Q_PROPERTY() macro, just like other properties. The \c host property declaration looks like this: - \snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1 + \snippet examples/qml/cppextensions/referenceexamples/properties/birthdayparty.h 1 As long as the property type, in this case \c Person, is registered with QML the property can be assigned. @@ -259,7 +259,7 @@ Q_PROPERTY(int size READ size CONSTANT) for assignment to appropriately typed properties. - \snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0 + \snippet examples/qml/cppextensions/referenceexamples/properties/example.qml 0 The \c guests property is a \e{list property} of \c Person objects. A list of \c Person objects are bound to the \c BirthdayParty's \c host property, @@ -269,12 +269,12 @@ Q_PROPERTY(int size READ size CONSTANT) the Q_PROPERTY() macro. However, list properties must have the type \l{QQmlListProperty}{QQmlListProperty<T>}. - \snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2 + \snippet examples/qml/cppextensions/referenceexamples/properties/birthdayparty.h 2 As with the other property types, the type of list content, \a T, must be \l{register-c++-type}{registered} into the runtime. - \snippet examples/declarative/cppextensions/referenceexamples/properties/main.cpp register list + \snippet examples/qml/cppextensions/referenceexamples/properties/main.cpp register list \l {Extending QML - Object and List Property Types Example} shows the complete code used to create the \c BirthdayParty type. For more @@ -352,7 +352,7 @@ Q_PROPERTY(int size READ size CONSTANT) Here is the \c host property declaration: - \snippet examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h 0 + \snippet examples/qml/cppextensions/referenceexamples/binding/birthdayparty.h 0 The NOTIFY attribute is followed by a signal name. It is the responsibility of the class implementer to ensure that whenever the property's value @@ -393,7 +393,7 @@ Q_PROPERTY(int size READ size CONSTANT) attribute may be added to the property declaration instead of a NOTIFY signal. - \snippet examples/declarative/cppextensions/referenceexamples/binding/person.h 0 + \snippet examples/qml/cppextensions/referenceexamples/binding/person.h 0 Extreme care must be taken here or applications using your type may misbehave. The CONSTANT attribute should only be used for properties whose value is set, @@ -412,10 +412,10 @@ Q_PROPERTY(int size READ size CONSTANT) character of the signal is uppercased for the signal handler. The signal parameter is also availabe to the QML signal. - \snippet examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h 0 + \snippet examples/qml/cppextensions/referenceexamples/signal/birthdayparty.h 0 The QML engine will create a handler for the \c partyStarted signal called \c onPartyStarted. - \snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 0 + \snippet examples/qml/cppextensions/referenceexamples/signal/example.qml 0 Classes may have multiple signals with the same name, but only the final signal is accessible as a QML signal. Note that signals with the same name @@ -442,11 +442,11 @@ Q_PROPERTY(int size READ size CONSTANT) The Q_INVOKABLE macro exposes any Qt C++ method as a QML method. - \snippet examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.h 0 + \snippet examples/qml/cppextensions/referenceexamples/methods/birthdayparty.h 0 In a QML file, we can invoke the method as we would a \l{JavaScript Expressions in QML}{JavaScript expression}. - \snippet examples/declarative/cppextensions/referenceexamples/methods/example.qml 0 + \snippet examples/qml/cppextensions/referenceexamples/methods/example.qml 0 \l {Extending QML - Methods Example}{Methods example} uses the Q_INVOKABLE method to expose methods and demonstrates some usages of the method in diff --git a/src/qml/doc/src/bindings/qmlplugins.qdoc b/src/qml/doc/src/bindings/qmlplugins.qdoc index 08704ac9a9..ec0d608b32 100644 --- a/src/qml/doc/src/bindings/qmlplugins.qdoc +++ b/src/qml/doc/src/bindings/qmlplugins.qdoc @@ -63,7 +63,7 @@ as a new QML element. It provides the current time through \c hour and \c minute properties. - \snippet examples/declarative/cppextensions/plugins/plugin.cpp 0 + \snippet examples/qml/cppextensions/plugins/plugin.cpp 0 \dots A plugin class, \c QExampleQMLPlugin, is a subclass of @@ -75,9 +75,9 @@ runtime with the qmlRegisterType() function. The Q_EXPORT_PLUGIN2() macro has two parameters, the generated plugin name and the class name. - \snippet examples/declarative/cppextensions/plugins/plugin.cpp plugin + \snippet examples/qml/cppextensions/plugins/plugin.cpp plugin \codeline - \snippet examples/declarative/cppextensions/plugins/plugin.cpp export + \snippet examples/qml/cppextensions/plugins/plugin.cpp export The \c TimeModel class receives a \c{1.0} version of this plugin library, as a QML type called \c Time. The Q_ASSERT() macro can ensure the module is @@ -108,13 +108,13 @@ includes a \c Clock.qml file that should be bundled with the plugin, so it needs to be specified in the \c qmldir file: - \quotefile examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir + \quotefile examples/qml/cppextensions/plugins/com/nokia/TimeExample/qmldir Once the project is built and installed, the new \c Time component is accessible by any QML component that imports the \c com.nokia.TimeExample module - \snippet examples/declarative/cppextensions/plugins/plugins.qml 0 + \snippet examples/qml/cppextensions/plugins/plugins.qml 0 The full source code is available in the \l {declarative/cppextensions/plugins}{plugins example}. diff --git a/src/qml/doc/src/bindings/qmltypes.qdoc b/src/qml/doc/src/bindings/qmltypes.qdoc index b4c52988cb..c5f4ee8f8b 100644 --- a/src/qml/doc/src/bindings/qmltypes.qdoc +++ b/src/qml/doc/src/bindings/qmltypes.qdoc @@ -53,16 +53,16 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c QML context. The class must be a subclass of \l{QObject} and have a default constructor. The \l{The Property System}{properties} created with the Q_PROPERTY macro are visible in the QML context as well. - \snippet declarative/cppextensions/referenceexamples/adding/person.h 0 + \snippet examples/qml/cppextensions/referenceexamples/adding/person.h 0 The application registers the class to the runtime with the \l{qmlRegisterType()}. - \snippet declarative/cppextensions/referenceexamples/adding/main.cpp 0 + \snippet examples/qml/cppextensions/referenceexamples/adding/main.cpp 0 The Person type is then imported with the \c "People 1.0" module and its properties are accessible in a QML file. -\snippet declarative/cppextensions/referenceexamples/adding/example.qml 0 + \snippet examples/qml/cppextensions/referenceexamples/adding/example.qml 0 The \l {Extending QML - Adding Types Example}{Adding Types} example demonstrates as usage of the \l qmlRegisterType(). @@ -91,7 +91,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c way as regular properties. Thus, the lists or pointers are created as properties using the Q_PROPERTY() macro. - \snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1 + \snippet examples/qml/cppextensions/referenceexamples/properties/birthdayparty.h 1 The \c host is an \l{qml-expose-properties}{exposed property} that can bind to objects or lists of objects. The property type, in this case \c Person, @@ -216,7 +216,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c that allow the assignment of specialized classes to object or list properties. - \snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0 + \snippet examples/qml/cppextensions/referenceexamples/coercion/example.qml 0 The QML snippet shown above assigns a \c Boy object to the \c BirthdayParty's \c host property, and assigns three other objects to the \c @@ -240,8 +240,8 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c define a mapping between the C++ class and a QML element name, so the type is not instantiable from QML, but it is available for type coercion. - \snippet examples/declarative/cppextensions/referenceexamples/coercion/main.cpp 0 - \snippet examples/declarative/cppextensions/referenceexamples/coercion/main.cpp register boy girl + \snippet examples/qml/cppextensions/referenceexamples/coercion/main.cpp 0 + \snippet examples/qml/cppextensions/referenceexamples/coercion/main.cpp register boy girl The \c Person class is registered withouth the parameters. Both the \c Boy and \c Girl class derive from the \c Person class. @@ -258,7 +258,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c \target qml-c++-extension \section1 Extension Objects - \snippet examples/declarative/cppextensions/referenceexamples/extended/example.qml 0 + \snippet examples/qml/cppextensions/referenceexamples/extended/example.qml 0 The \c leftMargin property is a new property to an existing C++ type, \l QLineEdit, without modifying its source code. @@ -303,8 +303,8 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c \section1 Property Value Sources -\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0 -\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 1 +\snippet examples/qml/cppextensions/referenceexamples/valuesource/example.qml 0 +\snippet examples/qml/cppextensions/referenceexamples/valuesource/example.qml 1 The QML snippet shown above applies a property value source to the \c announcement property. A property value source generates a value for a property that changes over time. @@ -319,7 +319,7 @@ The example shown here is rather contrived: the \c announcement property of the the \c HappyBirthdaySong value source generates the lyrics of the song "Happy Birthday". -\snippet examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h 0 +\snippet examples/qml/cppextensions/referenceexamples/valuesource/birthdayparty.h 0 Normally, assigning an object to a string property would not be allowed. In the case of a property value source, rather than assigning the object instance @@ -332,9 +332,9 @@ QQmlPropertyValueSource::setTarget(), that the QML engine invokes when associating the property value source with a property. The relevant part of the \c HappyBirthdaySong type declaration looks like this: -\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 0 -\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 1 -\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 2 +\snippet examples/qml/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 0 +\snippet examples/qml/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 1 +\snippet examples/qml/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 2 In all other respects, property value sources are regular QML types. They must be registered with the QML engine using the same macros as other types, and can diff --git a/src/qml/doc/src/bindings/qtbinding.qdoc b/src/qml/doc/src/bindings/qtbinding.qdoc index 49a856527c..f5a4feeec6 100644 --- a/src/qml/doc/src/bindings/qtbinding.qdoc +++ b/src/qml/doc/src/bindings/qtbinding.qdoc @@ -115,8 +115,8 @@ a displayable QML component into a QWidget-based application. For example, suppose there is a \c MyItem.qml file that looks like this: -\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml start -\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml end +\snippet qml/qtbinding/loading/MyItem.qml start +\snippet qml/qtbinding/loading/MyItem.qml end This QML document can be loaded with QQmlComponent or QQuickView with the following C++ code. Using a QQmlComponent requires calling QQmlComponent::create() to create @@ -126,23 +126,23 @@ component, which is accessible via QQuickView::rootObject(): \table \row \li -\snippet doc/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-a +\snippet qml/qtbinding/loading/main.cpp QQmlComponent-a \dots 0 -\snippet doc/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-b +\snippet qml/qtbinding/loading/main.cpp QQmlComponent-b \li -\snippet doc/snippets/qml/qtbinding/loading/main.cpp QQuickView +\snippet qml/qtbinding/loading/main.cpp QQuickView \endtable This \c object is the instance of the \c MyItem.qml component that has been created. You can now modify the item's properties using QObject::setProperty() or QQmlProperty: -\snippet doc/snippets/qml/qtbinding/loading/main.cpp properties +\snippet qml/qtbinding/loading/main.cpp properties Alternatively, you can cast the object to its actual type and call functions with compile-time safety. In this case the base object of \c MyItem.qml is an \l Item, which is defined by the QQuickItem class: -\snippet doc/snippets/qml/qtbinding/loading/main.cpp cast +\snippet qml/qtbinding/loading/main.cpp cast You can also connect to any signals or call functions defined in the component using QMetaObject::invokeMethod() and QObject::connect(). See \l {Exchanging data between QML and C++} @@ -154,14 +154,14 @@ QML components are essentially object trees with children that have siblings and Child objects of QML components can be located using the QObject::objectName property with QObject::findChild(). For example, if the root item in \c MyItem.qml had a child \l Rectangle item: -\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml start +\snippet qml/qtbinding/loading/MyItem.qml start \codeline -\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml child -\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml end +\snippet qml/qtbinding/loading/MyItem.qml child +\snippet qml/qtbinding/loading/MyItem.qml end The child could be located like this: -\snippet doc/snippets/qml/qtbinding/loading/main.cpp findChild +\snippet qml/qtbinding/loading/main.cpp findChild If \c objectName is used inside a delegate of a ListView, \l Repeater or some other element that creates multiple instances of its delegates, there will be multiple children with @@ -187,12 +187,12 @@ component, allowing data to be injected from C++ into QML. For example, here is a QML item that refers to a \c currentDateTime value that does not exist in the current scope: -\snippet doc/snippets/qml/qtbinding/context/MyItem.qml 0 +\snippet qml/qtbinding/context/MyItem.qml 0 This \c currentDateTime value can be set directly by the C++ application that loads the QML component, using QQmlContext::setContextProperty(): -\snippet doc/snippets/qml/qtbinding/context/main.cpp 0 +\snippet qml/qtbinding/context/main.cpp 0 Context properties can hold either QVariant or QObject* values. This means custom C++ objects can also be injected using this approach, and these objects can be modified and read directly in QML. @@ -202,11 +202,11 @@ invokes a method on the object instance: \table \row \li -\snippet doc/snippets/qml/qtbinding/context-advanced/applicationdata.h 0 +\snippet qml/qtbinding/context-advanced/applicationdata.h 0 \codeline -\snippet doc/snippets/qml/qtbinding/context-advanced/main.cpp 0 +\snippet qml/qtbinding/context-advanced/main.cpp 0 \li -\snippet doc/snippets/qml/qtbinding/context-advanced/MyItem.qml 0 +\snippet qml/qtbinding/context-advanced/MyItem.qml 0 \endtable (Note that date/time values returned from C++ to QML can be formatted through @@ -217,7 +217,7 @@ If the QML item needs to receive signals from the context property, it can conne dataChanged(), this signal can be connected to using an \c onDataChanged handler within a \l Connections object: -\snippet doc/snippets/qml/qtbinding/context-advanced/connections.qml 0 +\snippet qml/qtbinding/context-advanced/connections.qml 0 Context properties can be useful for using C++ based data models in a QML view. See the \l {declarative/modelviews/stringlistmodel}{String ListModel}, @@ -242,17 +242,17 @@ it does not paint anything; you will need to clear this if your item is supposed For example, here is an \c ImageViewer class with an \c image URL property: -\snippet doc/snippets/qml/qtbinding/newelements/imageviewer.h 0 +\snippet qml/qtbinding/newelements/imageviewer.h 0 Aside from the fact that it inherits QQuickItem, this is an ordinary class that could exist outside of QML. However, once it is registered with the QML engine using qmlRegisterType(): -\snippet doc/snippets/qml/qtbinding/newelements/main.cpp register +\snippet qml/qtbinding/newelements/main.cpp register Then, any QML code loaded by your C++ application or \l{QQmlExtensionPlugin}{plugin} can create and manipulate \c ImageViewer objects: -\snippet doc/snippets/qml/qtbinding/newelements/standalone.qml 0 +\snippet qml/qtbinding/newelements/standalone.qml 0 It is advised that you avoid using QGraphicsItem functionality beyond the properties documented in QQuickItem. @@ -286,8 +286,8 @@ QMetaObject::invokeMethod(). Here is a C++ application that uses this to call a \table \row -\li \snippet doc/snippets/qml/qtbinding/functions-qml/MyItem.qml 0 -\li \snippet doc/snippets/qml/qtbinding/functions-qml/main.cpp 0 +\li \snippet qml/qtbinding/functions-qml/MyItem.qml 0 +\li \snippet qml/qtbinding/functions-qml/main.cpp 0 \endtable Notice the Q_RETURN_ARG() and Q_ARG() arguments for QMetaObject::invokeMethod() must be specified as @@ -300,11 +300,11 @@ methods on the \c myObject object, which has been set using QQmlContext::setCont \table \row \li -\snippet doc/snippets/qml/qtbinding/functions-cpp/MyItem.qml 0 +\snippet qml/qtbinding/functions-cpp/MyItem.qml 0 \li -\snippet doc/snippets/qml/qtbinding/functions-cpp/myclass.h 0 +\snippet qml/qtbinding/functions-cpp/myclass.h 0 \codeline -\snippet doc/snippets/qml/qtbinding/functions-cpp/main.cpp 0 +\snippet qml/qtbinding/functions-cpp/main.cpp 0 \endtable QML supports the calling of overloaded C++ functions. If there are multiple C++ functions with the @@ -325,11 +325,11 @@ is emitted: \table \row \li -\snippet doc/snippets/qml/qtbinding/signals-qml/MyItem.qml 0 +\snippet qml/qtbinding/signals-qml/MyItem.qml 0 \li -\snippet doc/snippets/qml/qtbinding/signals-qml/myclass.h 0 +\snippet qml/qtbinding/signals-qml/myclass.h 0 \codeline -\snippet doc/snippets/qml/qtbinding/signals-qml/main.cpp 0 +\snippet qml/qtbinding/signals-qml/main.cpp 0 \endtable To connect to Qt C++ signals from within QML, use a signal handler with the \c on<SignalName> syntax. @@ -342,12 +342,12 @@ C++ object are connected to through \c onImagedChanged and \c onLoadingError sig \row \li -\snippet doc/snippets/qml/qtbinding/signals-cpp/imageviewer.h start +\snippet qml/qtbinding/signals-cpp/imageviewer.h start \dots 4 -\snippet doc/snippets/qml/qtbinding/signals-cpp/imageviewer.h end +\snippet qml/qtbinding/signals-cpp/imageviewer.h end \li -\snippet doc/snippets/qml/qtbinding/signals-cpp/standalone.qml 0 +\snippet qml/qtbinding/signals-cpp/standalone.qml 0 \endtable (Note that if a signal has been declared as the NOTIFY signal for a property, QML allows it to be @@ -362,8 +362,8 @@ instead to create the signal handler: \table \row -\li \snippet doc/snippets/qml/qtbinding/signals-cpp/main.cpp connections -\li \snippet doc/snippets/qml/qtbinding/signals-cpp/MyItem.qml 0 +\li \snippet qml/qtbinding/signals-cpp/main.cpp connections +\li \snippet qml/qtbinding/signals-cpp/MyItem.qml 0 \endtable C++ signals can use enum values as parameters provided that the enum is declared in the @@ -376,12 +376,12 @@ See \l {Using enumerations of a custom type} below for details. Any properties declared in a QML object are automatically accessible from C++. Given a QML item like this: -\snippet doc/snippets/qml/qtbinding/properties-qml/MyItem.qml 0 +\snippet qml/qtbinding/properties-qml/MyItem.qml 0 The value of the \c someNumber property can be set and read using QQmlProperty, or QObject::setProperty() and QObject::property(): -\snippet doc/snippets/qml/qtbinding/properties-qml/main.cpp 0 +\snippet qml/qtbinding/properties-qml/main.cpp 0 You should always use QObject::setProperty(), QQmlProperty or QMetaProperty::write() to change a QML property value, to ensure the QML engine is made aware of the property change. For example, @@ -410,8 +410,8 @@ property. This property can be written to and read from QML: \table \row -\li \snippet doc/snippets/qml/qtbinding/properties-cpp/applicationdata.h 0 -\li \snippet doc/snippets/qml/qtbinding/properties-cpp/MyItem.qml 0 +\li \snippet qml/qtbinding/properties-cpp/applicationdata.h 0 +\li \snippet qml/qtbinding/properties-cpp/MyItem.qml 0 \endtable Notice the \c backgroundColorChanged signal is declared as the NOTIFY signal for the @@ -468,8 +468,8 @@ converted to JavaScript array and object values, repectively: \li String format \li Example \row -\li \snippet doc/snippets/qml/qtbinding/variantlistmap/MyItem.qml 0 -\li \snippet doc/snippets/qml/qtbinding/variantlistmap/main.cpp 0 +\li \snippet qml/qtbinding/variantlistmap/MyItem.qml 0 +\li \snippet qml/qtbinding/variantlistmap/main.cpp 0 \endtable This produces output like: @@ -492,13 +492,13 @@ side, and is automatically converted to a QVariantList or QVariantMap when it is To use an enumeration from a custom C++ component, the enumeration must be declared with Q_ENUMS() to register it with Qt's meta object system. For example, the following C++ type has a \c Status enum: -\snippet doc/snippets/qml/qtbinding/enums/imageviewer.h start -\snippet doc/snippets/qml/qtbinding/enums/imageviewer.h end +\snippet qml/qtbinding/enums/imageviewer.h start +\snippet qml/qtbinding/enums/imageviewer.h end Providing the \c ImageViewer class has been registered using qmlRegisterType(), its \c Status enum can now be used from QML: -\snippet doc/snippets/qml/qtbinding/enums/standalone.qml 0 +\snippet qml/qtbinding/enums/standalone.qml 0 The C++ type must be registered with QML to use its enums. If your C++ type is not instantiable, it can be registered using qmlRegisterUncreatableType(). To be accessible from QML, the names of enum values @@ -525,7 +525,7 @@ function, the enum type must be registered using qRegisterMetaType(). For QML signals, enum values may be used as signal parameters using the \c int type: -\snippet doc/snippets/qml/qtbinding/enums/standalone.qml 1 +\snippet qml/qtbinding/enums/standalone.qml 1 \section2 Automatic Type Conversion from Strings @@ -643,22 +643,22 @@ project The \c main.qml and \c background.png files will be packaged as resource files. This is done in the \c example.qrc resource collection file: -\quotefile doc/src/snippets/qml/qtbinding/resources/example.qrc +\quotefile qml/qtbinding/resources/example.qrc Since \c background.png is a resource file, \c main.qml can refer to it using the relative path specified in \c example.qrc: -\snippet doc/snippets/qml/qtbinding/resources/main.qml 0 +\snippet qml/qtbinding/resources/main.qml 0 To allow QML to locate resource files correctly, the \c main.cpp loads the main QML file, \c main.qml, as a resource file using the \c qrc scheme: -\snippet doc/snippets/qml/qtbinding/resources/main.cpp 0 +\snippet qml/qtbinding/resources/main.cpp 0 Finally \c project.pro uses the RESOURCES variable to indicate that \c example.qrc should be used to build the application resources: -\quotefile doc/src/snippets/qml/qtbinding/resources/resources.pro +\quotefile qml/qtbinding/resources/resources.pro See \l {The Qt Resource System} for more information. diff --git a/src/qml/doc/src/debugging.qdoc b/src/qml/doc/src/debugging.qdoc index 462b2feb4c..11bd82c272 100644 --- a/src/qml/doc/src/debugging.qdoc +++ b/src/qml/doc/src/debugging.qdoc @@ -55,13 +55,13 @@ code location of the call. \c console.assert tests that an expression is true. If not, it will write an optional message to the console and print the stack trace. -\qml +\code function f() { var x = 12 console.assert(x == 12, "This will pass"); console.assert(x > 12, "This will fail"); } -\endqml +\endcode \section2 Timer @@ -90,11 +90,11 @@ and column number. The stack trace is limited to last 10 stack frames. \c console.count prints the current number of times a particular piece of code has been executed, along with a message. That is, -\qml +\code function f() { console.count("f called"); } -\endqml +\endcode will print \c{f called: 1}, \c{f called: 2} ... whenever \c{f()} is executed. diff --git a/src/qml/doc/src/engine/qmlengine.qdoc b/src/qml/doc/src/engine/qmlengine.qdoc index fca3b984ff..07bce90b0f 100644 --- a/src/qml/doc/src/engine/qmlengine.qdoc +++ b/src/qml/doc/src/engine/qmlengine.qdoc @@ -98,8 +98,8 @@ specified in QML files, plugins, or applications. For example, suppose there is a \c MyItem.qml file that looks like this: - \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml start - \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml end + \snippet qml/qtbinding/loading/MyItem.qml start + \snippet qml/qtbinding/loading/MyItem.qml end This QML document can be loaded with QQmlComponent or QQuickView with the following C++ code. Using a QQmlComponent @@ -110,24 +110,24 @@ specified in QML files, plugins, or applications. \table \row \li - \snippet doc/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-a + \snippet qml/qtbinding/loading/main.cpp QQmlComponent-a \dots 0 - \snippet doc/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-b + \snippet qml/qtbinding/loading/main.cpp QQmlComponent-b \li - \snippet doc/snippets/qml/qtbinding/loading/main.cpp QQuickView + \snippet qml/qtbinding/loading/main.cpp QQuickView \endtable This \c object is the instance of the \c MyItem.qml component that has been created. You can now modify the item's properties using QObject::setProperty() or QQmlProperty: - \snippet doc/snippets/qml/qtbinding/loading/main.cpp properties + \snippet qml/qtbinding/loading/main.cpp properties Alternatively, you can cast the object to its actual type and call functions with compile-time safety. In this case the base object of \c MyItem.qml is an \l Item, which is defined by the QQuickItem class: - \snippet doc/snippets/qml/qtbinding/loading/main.cpp cast + \snippet qml/qtbinding/loading/main.cpp cast You can also connect to any signals or call functions defined in the component using QMetaObject::invokeMethod() and QObject::connect(). See \l @@ -140,14 +140,14 @@ specified in QML files, plugins, or applications. the QObject::objectName property with QObject::findChild(). For example, if the root item in \c MyItem.qml had a child \l Rectangle item: - \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml start + \snippet qml/qtbinding/loading/MyItem.qml start \codeline - \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml child - \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml end + \snippet qml/qtbinding/loading/MyItem.qml child + \snippet qml/qtbinding/loading/MyItem.qml end The child could be located like this: - \snippet doc/snippets/qml/qtbinding/loading/main.cpp findChild + \snippet qml/qtbinding/loading/main.cpp findChild If \c objectName is used inside a delegate of a ListView, \l Repeater or some other element that creates multiple instances of its delegates, there @@ -178,13 +178,13 @@ specified in QML files, plugins, or applications. For example, here is a QML item that refers to a \c currentDateTime value that does not exist in the current scope: - \snippet doc/snippets/qml/qtbinding/context/MyItem.qml 0 + \snippet qml/qtbinding/context/MyItem.qml 0 This \c currentDateTime value can be set directly by the C++ application that loads the QML component, using QQmlContext::setContextProperty(): - \snippet doc/snippets/qml/qtbinding/context/main.cpp 0 + \snippet qml/qtbinding/context/main.cpp 0 Context properties can hold either QVariant or QObject* values. This means custom C++ objects can also be injected using this approach, and these @@ -195,11 +195,11 @@ specified in QML files, plugins, or applications. \table \row \li - \snippet doc/snippets/qml/qtbinding/context-advanced/applicationdata.h 0 + \snippet qml/qtbinding/context-advanced/applicationdata.h 0 \codeline - \snippet doc/snippets/qml/qtbinding/context-advanced/main.cpp 0 + \snippet qml/qtbinding/context-advanced/main.cpp 0 \li - \snippet doc/snippets/qml/qtbinding/context-advanced/MyItem.qml 0 + \snippet qml/qtbinding/context-advanced/MyItem.qml 0 \endtable (Note that date/time values returned from C++ to QML can be formatted through @@ -211,7 +211,7 @@ specified in QML files, plugins, or applications. connected to using an \c onDataChanged handler within a \l Connections object: - \snippet doc/snippets/qml/qtbinding/context-advanced/connections.qml 0 + \snippet qml/qtbinding/context-advanced/connections.qml 0 Context properties can be useful for using C++ based data models in a QML view. See the \l {declarative/modelviews/stringlistmodel}{String ListModel}, @@ -245,8 +245,8 @@ specified in QML files, plugins, or applications. \table \row - \li \snippet doc/snippets/qml/qtbinding/functions-qml/MyItem.qml 0 - \li \snippet doc/snippets/qml/qtbinding/functions-qml/main.cpp 0 + \li \snippet qml/qtbinding/functions-qml/MyItem.qml 0 + \li \snippet qml/qtbinding/functions-qml/main.cpp 0 \endtable Notice the Q_RETURN_ARG() and Q_ARG() arguments for @@ -261,11 +261,11 @@ specified in QML files, plugins, or applications. \table \row \li - \snippet doc/snippets/qml/qtbinding/functions-cpp/MyItem.qml 0 + \snippet qml/qtbinding/functions-cpp/MyItem.qml 0 \li - \snippet doc/snippets/qml/qtbinding/functions-cpp/myclass.h 0 + \snippet qml/qtbinding/functions-cpp/myclass.h 0 \codeline - \snippet doc/snippets/qml/qtbinding/functions-cpp/main.cpp 0 + \snippet qml/qtbinding/functions-cpp/main.cpp 0 \endtable QML supports the calling of overloaded C++ functions. If there are multiple @@ -288,11 +288,11 @@ specified in QML files, plugins, or applications. \table \row \li - \snippet doc/snippets/qml/qtbinding/signals-qml/MyItem.qml 0 + \snippet qml/qtbinding/signals-qml/MyItem.qml 0 \li - \snippet doc/snippets/qml/qtbinding/signals-qml/myclass.h 0 + \snippet qml/qtbinding/signals-qml/myclass.h 0 \codeline - \snippet doc/snippets/qml/qtbinding/signals-qml/main.cpp 0 + \snippet qml/qtbinding/signals-qml/main.cpp 0 \endtable To connect to Qt C++ signals from within QML, use a signal handler with the @@ -307,12 +307,12 @@ specified in QML files, plugins, or applications. \row \li - \snippet doc/snippets/qml/qtbinding/signals-cpp/imageviewer.h start + \snippet qml/qtbinding/signals-cpp/imageviewer.h start \dots 4 - \snippet doc/snippets/qml/qtbinding/signals-cpp/imageviewer.h end + \snippet qml/qtbinding/signals-cpp/imageviewer.h end \li - \snippet doc/snippets/qml/qtbinding/signals-cpp/standalone.qml 0 + \snippet qml/qtbinding/signals-cpp/standalone.qml 0 \endtable (Note that if a signal has been declared as the NOTIFY signal for a @@ -330,8 +330,8 @@ specified in QML files, plugins, or applications. \table \row - \li \snippet doc/snippets/qml/qtbinding/signals-cpp/main.cpp connections - \li \snippet doc/snippets/qml/qtbinding/signals-cpp/MyItem.qml 0 + \li \snippet qml/qtbinding/signals-cpp/main.cpp connections + \li \snippet qml/qtbinding/signals-cpp/MyItem.qml 0 \endtable C++ signals can use enum values as parameters provided that the enum is @@ -345,12 +345,12 @@ specified in QML files, plugins, or applications. Any properties declared in a QML object are automatically accessible from C++. Given a QML item like this: - \snippet doc/snippets/qml/qtbinding/properties-qml/MyItem.qml 0 + \snippet qml/qtbinding/properties-qml/MyItem.qml 0 The value of the \c someNumber property can be set and read using QQmlProperty, or QObject::setProperty() and QObject::property(): - \snippet doc/snippets/qml/qtbinding/properties-qml/main.cpp 0 + \snippet qml/qtbinding/properties-qml/main.cpp 0 You should always use QObject::setProperty(), QQmlProperty or QMetaProperty::write() to change a QML property value, to ensure the QML @@ -380,8 +380,8 @@ specified in QML files, plugins, or applications. \table \row - \li \snippet doc/snippets/qml/qtbinding/properties-cpp/applicationdata.h 0 - \li \snippet doc/snippets/qml/qtbinding/properties-cpp/MyItem.qml 0 + \li \snippet qml/qtbinding/properties-cpp/applicationdata.h 0 + \li \snippet qml/qtbinding/properties-cpp/MyItem.qml 0 \endtable Notice the \c backgroundColorChanged signal is declared as the NOTIFY signal diff --git a/src/qml/doc/src/engine/qtjavascript.qdoc b/src/qml/doc/src/engine/qtjavascript.qdoc index a7ffc8550a..2521e8d91f 100644 --- a/src/qml/doc/src/engine/qtjavascript.qdoc +++ b/src/qml/doc/src/engine/qtjavascript.qdoc @@ -56,7 +56,7 @@ evaluate() function, passing the script code (text) to evaluate as argument. - \snippet doc/snippets/qtjavascript/evaluation/main.cpp 0 + \snippet qtjavascript/evaluation/main.cpp 0 The return value will be the result of the evaluation (represented as a QJSValue object); this can be converted to standard C++ @@ -66,7 +66,7 @@ them with the script engine. This is most easily done by setting properties of the script engine's \e{Global Object}: - \snippet doc/snippets/qtjavascript/registeringvalues/main.cpp 0 + \snippet qtjavascript/registeringvalues/main.cpp 0 This places the properties in the script environment, thus making them available to script code. @@ -83,7 +83,7 @@ Here's an example of making an instance of a QObject subclass available to script code under the name \c{"myObject"}: - \snippet doc/snippets/qtjavascript/registeringobjects/main.cpp 0 + \snippet qtjavascript/registeringobjects/main.cpp 0 This will create a global variable called \c{myObject} in the script environment. The variable serves as a proxy to the diff --git a/src/qml/doc/src/qml/basictypes.qdoc b/src/qml/doc/src/qml/basictypes.qdoc index 8ba7cc460e..1177a12e94 100644 --- a/src/qml/doc/src/qml/basictypes.qdoc +++ b/src/qml/doc/src/qml/basictypes.qdoc @@ -180,7 +180,8 @@ \div{float-right} \inlineimage declarative-colors.png \enddiv - \snippet doc/snippets/qml/colors.qml colors + + \snippet qml/colors.qml colors Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions: diff --git a/src/qml/doc/src/qml/codingconventions.qdoc b/src/qml/doc/src/qml/codingconventions.qdoc index 04af57012a..89a1bd8cb3 100644 --- a/src/qml/doc/src/qml/codingconventions.qdoc +++ b/src/qml/doc/src/qml/codingconventions.qdoc @@ -52,7 +52,7 @@ For better readability, we separate these different parts with an empty line. For example, a hypothetical \e photo QML object would look like this: -\snippet doc/snippets/qml/codingconventions/photo.qml 0 +\snippet qml/codingconventions/photo.qml 0 \section1 Grouped Properties @@ -62,11 +62,11 @@ we use the \e {group notation} rather than the \e {dot notation} to improve read For example, this: -\snippet doc/snippets/qml/codingconventions/dotproperties.qml 0 +\snippet qml/codingconventions/dotproperties.qml 0 can be written like this: -\snippet doc/snippets/qml/codingconventions/dotproperties.qml 1 +\snippet qml/codingconventions/dotproperties.qml 1 \section1 Private Properties @@ -78,7 +78,7 @@ the implementation. As a convention, private properties begin with two accessible but is not meant for public use. Note that QML and JavaScript will grant the user access to these properties. -\snippet doc/snippets/qml/codingconventions/private.qml 0 +\snippet qml/codingconventions/private.qml 0 \section1 Lists @@ -89,30 +89,30 @@ For example, it is very common for a component to only have one state. In this case, instead of: -\snippet doc/snippets/qml/codingconventions/lists.qml 0 +\snippet qml/codingconventions/lists.qml 0 we will write this: -\snippet doc/snippets/qml/codingconventions/lists.qml 1 +\snippet qml/codingconventions/lists.qml 1 \section1 JavaScript Code If the script is a single expression, we recommend writing it inline: -\snippet doc/snippets/qml/codingconventions/javascript.qml 0 +\snippet qml/codingconventions/javascript.qml 0 If the script is only a couple of lines long, we generally use a block: -\snippet doc/snippets/qml/codingconventions/javascript.qml 1 +\snippet qml/codingconventions/javascript.qml 1 If the script is more than a couple of lines long or can be used by different objects, we recommend creating a function and calling it like this: -\snippet doc/snippets/qml/codingconventions/javascript.qml 2 +\snippet qml/codingconventions/javascript.qml 2 For long scripts, we will put the functions in their own JavaScript file and import it like this: -\snippet doc/snippets/qml/codingconventions/javascript-imports.qml 0 +\snippet qml/codingconventions/javascript-imports.qml 0 */ diff --git a/src/qml/doc/src/qml/dynamicobjects.qdoc b/src/qml/doc/src/qml/dynamicobjects.qdoc index caa4e63744..f5a47b8915 100644 --- a/src/qml/doc/src/qml/dynamicobjects.qdoc +++ b/src/qml/doc/src/qml/dynamicobjects.qdoc @@ -80,31 +80,31 @@ the component. This function can take one or two arguments: Here is an example. First there is \c Sprite.qml, which defines a simple QML component: -\snippet doc/snippets/qml/Sprite.qml 0 +\snippet qml/Sprite.qml 0 Our main application file, \c main.qml, imports a \c componentCreation.js JavaScript file that will create \c Sprite objects: -\snippet doc/snippets/qml/createComponent.qml 0 +\snippet qml/createComponent.qml 0 Here is \c componentCreation.js. Notice it checks whether the component \l{Component::status}{status} is \c Component.Ready before calling \l {Component::createObject()}{createObject()} in case the QML file is loaded over a network and thus is not ready immediately. -\snippet doc/snippets/qml/componentCreation.js vars +\snippet qml/componentCreation.js vars \codeline -\snippet doc/snippets/qml/componentCreation.js func -\snippet doc/snippets/qml/componentCreation.js remote -\snippet doc/snippets/qml/componentCreation.js func-end +\snippet qml/componentCreation.js func +\snippet qml/componentCreation.js remote +\snippet qml/componentCreation.js func-end \codeline -\snippet doc/snippets/qml/componentCreation.js finishCreation +\snippet qml/componentCreation.js finishCreation If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation() function and call \l {Component::createObject()}{createObject()} immediately: -\snippet doc/snippets/qml/componentCreation.js func -\snippet doc/snippets/qml/componentCreation.js local -\snippet doc/snippets/qml/componentCreation.js func-end +\snippet qml/componentCreation.js func +\snippet qml/componentCreation.js local +\snippet qml/componentCreation.js func-end Notice in both instances, \l {Component::createObject()}{createObject()} is called with \c appWindow passed as an argument so that the created object will become a child of the @@ -126,7 +126,7 @@ It is also possible to instantiate components without blocking via the If the QML is not defined until runtime, you can create a QML item from a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example: -\snippet doc/snippets/qml/createQmlObject.qml 0 +\snippet qml/createQmlObject.qml 0 The first argument is the string of QML to create. Just like in a new file, you will need to import any types you wish to use. The second argument is the parent item for the new item; @@ -184,8 +184,8 @@ component. Each instance runs a NumberAnimation, and when the animation has fini \li \c SelfDestroyingRect.qml \row -\li \snippet doc/snippets/qml/dynamicObjects-destroy.qml 0 -\li \snippet doc/snippets/qml/SelfDestroyingRect.qml 0 +\li \snippet qml/dynamicObjects-destroy.qml 0 +\li \snippet qml/SelfDestroyingRect.qml 0 \endtable @@ -212,6 +212,6 @@ destroyed if they were dynamically created. Objects created with \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} can similarly be destroyed using \c destroy(): -\snippet doc/snippets/qml/createQmlObject.qml 0 -\snippet doc/snippets/qml/createQmlObject.qml destroy +\snippet qml/createQmlObject.qml 0 +\snippet qml/createQmlObject.qml destroy */ diff --git a/src/qml/doc/src/qml/javascriptblocks.qdoc b/src/qml/doc/src/qml/javascriptblocks.qdoc index 886289d9b7..f5bcca3a5a 100644 --- a/src/qml/doc/src/qml/javascriptblocks.qdoc +++ b/src/qml/doc/src/qml/javascriptblocks.qdoc @@ -200,8 +200,8 @@ in \c script.js: \table \row -\li \snippet doc/snippets/qml/integrating-javascript/connectjs.qml 0 -\li \snippet doc/snippets/qml/integrating-javascript/script.js 0 +\li \snippet qml/integrating-javascript/connectjs.qml 0 +\li \snippet qml/integrating-javascript/script.js 0 \endtable The \c jsFunction() will now be called whenever MouseArea's \c clicked signal is emitted. @@ -243,10 +243,10 @@ which in turn can call \c factorial() in \c factorial.js, as it has included \table \row -\li {1,2} \snippet doc/snippets/qml/integrating-javascript/includejs/app.qml 0 -\li \snippet doc/snippets/qml/integrating-javascript/includejs/script.js 0 +\li {1,2} \snippet qml/integrating-javascript/includejs/app.qml 0 +\li \snippet qml/integrating-javascript/includejs/script.js 0 \row -\li \snippet doc/snippets/qml/integrating-javascript/includejs/factorial.js 0 +\li \snippet qml/integrating-javascript/includejs/factorial.js 0 \endtable Notice that calling \l {QML:Qt::include()}{Qt.include()} imports all functions from @@ -488,11 +488,11 @@ themselves. For the following examples, imagine that we have defined the following class: -\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.h 0 +\snippet qml/integrating-javascript/scarceresources/avatarExample.h 0 and that we have registered it with the QML type-system as follows: -\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 0 +\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 0 The AvatarExample class has a property which is a pixmap. When the property is accessed in JavaScript scope, a copy of the resource will be created and @@ -507,9 +507,9 @@ unless the client explicitly preserves it. In the following example, the scarce resource will be automatically released after the binding evaluation is complete. -\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleOne.qml 0 +\snippet qml/integrating-javascript/scarceresources/exampleOne.qml 0 -\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 1 +\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 1 \section2 Example Two: Automatic Release Prevented By Reference @@ -518,9 +518,9 @@ released after the binding expression evaluation is complete, because there is a property var referencing the scarce resource. -\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleTwo.qml 0 +\snippet qml/integrating-javascript/scarceresources/exampleTwo.qml 0 -\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 2 +\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 2 \section2 Example Three: Explicit Preservation @@ -528,11 +528,11 @@ In this example, the resource must be explicitly preserved in order to prevent the declarative engine from automatically releasing the resource after evaluation of the imported script. -\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleThree.js 0 +\snippet qml/integrating-javascript/scarceresources/exampleThree.js 0 -\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleThree.qml 0 +\snippet qml/integrating-javascript/scarceresources/exampleThree.qml 0 -\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 3 +\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 3 \section2 Example Four: Explicit Destruction @@ -541,11 +541,11 @@ scarce resource variant. This example shows how a client may free system resources by releasing the scarce resource held in a JavaScript object, if required, during evaluation of a JavaScript expression. -\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleFour.js 0 +\snippet qml/integrating-javascript/scarceresources/exampleFour.js 0 -\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleFour.qml 0 +\snippet qml/integrating-javascript/scarceresources/exampleFour.qml 0 -\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 4 +\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 4 \section2 Example Five: Explicit Destruction And JavaScript References @@ -555,8 +555,8 @@ to one scarce resource is held, and the client calls destroy() on one of those references (to explicitly release the scarce resource), all of the references will be affected. -\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleFive.qml 0 +\snippet qml/integrating-javascript/scarceresources/exampleFive.qml 0 -\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 5 +\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 5 */ diff --git a/src/qml/doc/src/qml/network.qdoc b/src/qml/doc/src/qml/network.qdoc index 049bdddf5a..1df6f51202 100644 --- a/src/qml/doc/src/qml/network.qdoc +++ b/src/qml/doc/src/qml/network.qdoc @@ -113,7 +113,7 @@ content by URLs that can then be used directly in QML. For example, using these to access an on-line photography service would provide the QML application with URLs to photographs, which can be directly set on an \l Image \c source property. -See the \tt examples/declarative/flickr for a real demonstration of this. +See the \tt examples/quick/flickr for a real demonstration of this. \section1 Configuring the Network Access Manager diff --git a/src/qml/doc/src/qml/propertybinding.qdoc b/src/qml/doc/src/qml/propertybinding.qdoc index 3c764c4df3..219bb240ba 100644 --- a/src/qml/doc/src/qml/propertybinding.qdoc +++ b/src/qml/doc/src/qml/propertybinding.qdoc @@ -44,10 +44,10 @@ The syntax for properties is: Elements already possess useful properties but, to create custom properties, precede the property name with the keyword \c property. -\snippet doc/snippets/qml/properties.qml parent begin -\snippet doc/snippets/qml/properties.qml inherited properties -\snippet doc/snippets/qml/properties.qml custom properties -\snippet doc/snippets/qml/properties.qml parent end +\snippet qml/properties.qml parent begin +\snippet qml/properties.qml inherited properties +\snippet qml/properties.qml custom properties +\snippet qml/properties.qml parent end QML property rules coincide with many of JavaScript's property rules, for example, property names must begin with a lowercase letter. @@ -62,14 +62,14 @@ to other property values or data accessible in the application. The property val automatically kept up to date if the other properties or data values change. Property bindings are created in QML using the colon "\c {:}" before the value: -\snippet doc/snippets/qml/properties.qml property binding +\snippet qml/properties.qml property binding The property binding causes the width of the \c Rectangle to update whenever the \c {parent}'s width changes. QML extends a standards compliant JavaScript engine, so any valid JavaScript expression can be used as a property binding. Bindings can access object properties, make function calls and even use built-in JavaScript objects such as \c {Date} and \c {Math}. -\snippet doc/snippets/qml/properties.qml JavaScript sample +\snippet qml/properties.qml JavaScript sample While syntactically bindings can be of arbitrary complexity, if a binding starts to become overly complex - such as involving multiple lines, or imperative loops - it may be better @@ -82,13 +82,13 @@ function. When working with both QML and JavaScript, it is important to differentiate between QML property binding and JavaScript value assignment. In QML, a property binding is created using the colon "\c {:}". -\snippet doc/snippets/qml/properties.qml property binding +\snippet qml/properties.qml property binding The property binding causes the width of the \c Rectangle to update whenever the \c {parent}'s width changes. Assigning a property value (using the equals sign "\c {=}") does not create a property binding (unless explicitly assigned, see below). -\snippet doc/snippets/qml/properties.qml property assignment +\snippet qml/properties.qml property assignment Instead of creating a property binding, the assignment simply sets the \c Rectangle \c width value to a number when the \c Component.onCompleted code is invoked. @@ -185,7 +185,7 @@ Care must be taken when referring to the parent of an object property binding. Elements and components that are bound to properties are not necessarily set as children of the properties' component. -\snippet doc/snippets/qml/properties.qml object binding +\snippet qml/properties.qml object binding The code snippet has a \l Gradient element that attempts to print its parent's \c width value. However, the \c Gradient element is bound to the \c gradient property, not the \c children property of the \c Rectangle. As a result, the @@ -204,7 +204,7 @@ Certain objects provide additional properties by \e attaching properties to othe objects. For example, the \l Keys element have properties that can \e attach to other QML objects to provide keyboard handling. -\snippet doc/snippets/qml/properties.qml list attached property +\snippet qml/properties.qml list attached property The element \l ListView provides the delegate, \c listdelegate, the property \c isCurrentItem as an attached property. The \c ListView.isCurrentItem \e{attached property} provides highlight information to the delegate. @@ -220,7 +220,7 @@ to provide additional functionality to objects. Two prominent elements, \l Component and \l Keys element provide \l{QML Signal and Handler Event System}{signal handlers} as attached signal handlers. -\snippet doc/snippets/qml/properties.qml attached signal handler +\snippet qml/properties.qml attached signal handler Read the \l{QML Signal and Handler Event System} and the \l{Keyboard Focus in QML} articles for more information. @@ -231,14 +231,14 @@ Some properties may accept a binding to a list property, where more than one component can bind to the property. List properties allow multiple \l {State}{States}, \l {Gradient}{Gradients}, and other components to bind to a single property. -\snippet doc/snippets/qml/properties.qml list property +\snippet qml/properties.qml list property The list is enclosed in square brackets, with a comma separating the list elements. In cases where you are only assigning a single item to a list, you may omit the square brackets. -\snippet doc/snippets/qml/properties.qml single property +\snippet qml/properties.qml single property To access the list, use the \c index property. -\snippet doc/snippets/qml/properties.qml print list property +\snippet qml/properties.qml print list property The snippet code simply prints the name of the first state, \c FETCH. See the \l{list}{list type} documentation @@ -251,7 +251,7 @@ In some cases properties form a logical group and use either the \e dot notation or \e group notation. Grouped properties may be written both ways: -\snippet doc/snippets/qml/properties.qml grouped properties +\snippet qml/properties.qml grouped properties In the element documentation grouped properties are shown using the dot notation. @@ -274,18 +274,18 @@ Accessing the aliasing property is similar to accessing a regular property. In addition, the optional \c default keyword indicates that the aliasing property is a \l{Default Properties}{default property}. -\snippet doc/snippets/qml/Button.qml property alias +\snippet qml/Button.qml property alias When importing the component as a \c Button, the \c buttonlabel is directly accessible through the \c label property. -\snippet doc/snippets/qml/properties.qml alias usage +\snippet qml/properties.qml alias usage In addition, the \c id property may also be aliased and referred outside the component. -\snippet doc/snippets/qml/Button.qml parent begin -\snippet doc/snippets/qml/Button.qml id alias -\snippet doc/snippets/qml/Button.qml parent end +\snippet qml/Button.qml parent begin +\snippet qml/Button.qml id alias +\snippet qml/Button.qml parent end The \c imagebutton component has the ability to modify the child \l Image object and its properties. -\snippet doc/snippets/qml/properties.qml image alias +\snippet qml/properties.qml image alias Using aliases, properties may be exposed to the \l{qml-top-level-component}{top level component}. Exposing properties to the @@ -298,7 +298,7 @@ Aliases are only activated once the component when an uninitialized alias is referenced. Likewise, aliasing an aliasing property will also result in an error. -\snippet doc/snippets/qml/properties.qml alias complete +\snippet qml/properties.qml alias complete When importing the component, however, aliasing properties appear as regular Qt properties and consequently can be used in alias references. @@ -308,7 +308,7 @@ property, effectively overwriting the existing property. For example, the following component has a \c color alias property, named the same as the built-in \l {Rectangle::color} property: -\snippet doc/snippets/qml/properties.qml alias overwrite +\snippet qml/properties.qml alias overwrite Any object that use this component and refer to its \c color property will be referring to the alias rather than the ordinary \l {Rectangle::color} property. @@ -327,13 +327,13 @@ as the \e {default property}. For example, the State element's default property is its \l{State::changes}{changes} property. \l PropertyChanges elements may simply be placed as the \c{State}'s children and they will be bound to the \c changes property. -\snippet doc/snippets/qml/properties.qml state default +\snippet qml/properties.qml state default Similarly, the \l Item element's default property is its \l{Item::data}{data} property. The \c data property manages Item's \c children and \c resources properties. This way, different data types may be placed as direct children of the \c Item. -\snippet doc/snippets/qml/properties.qml default property +\snippet qml/properties.qml default property Reassigning a default property is useful when a component is reused. For example, the \l{declarative/ui-components/tabwidget}{TabWidget} example uses @@ -349,14 +349,14 @@ For example, to bind a property exposed from the \l{The QML Engine}{declarative runtime} or \l{QmlGlobalQtObject}{Qt object}, such as the \c system.brightness property, to a value written in QML, you could use the \l Binding element as follows: -\snippet doc/snippets/qml/properties.qml binding element +\snippet qml/properties.qml binding element \section1 Changing Property Values in States The \l PropertyChanges element is for setting property bindings within a \l State element to set a property binding. -\snippet doc/snippets/qml/properties.qml PropertyChanges element +\snippet qml/properties.qml PropertyChanges element The rectangle's \c color property will bind to the \c warning component's \c color property when its \c state is set to the \c WARNING state. */ diff --git a/src/qml/doc/src/qml/qmlcomponents.qdoc b/src/qml/doc/src/qml/qmlcomponents.qdoc index bf95aba72f..9d0da72646 100644 --- a/src/qml/doc/src/qml/qmlcomponents.qdoc +++ b/src/qml/doc/src/qml/qmlcomponents.qdoc @@ -50,7 +50,7 @@ is the emphasis in QML. Any snippet of QML code may become a component, by placing the code in a QML file, whose file extension is \c .qml). A complete Button component that responds to user input may be in a Button.qml file. -\snippet doc/snippets/qml/reusablecomponents/Button.qml document +\snippet qml/reusablecomponents/Button.qml document The component name, \c Button, matches the QML filename, \c Button.qml. Also, the first character is in upper case. Matching the names allow @@ -60,9 +60,9 @@ naming components with different filenames. Alternatively, a \l Component element may encapsulate a QML object to form a component. -\snippet doc/snippets/qml/reusablecomponents/component.qml parent begin -\snippet doc/snippets/qml/reusablecomponents/component.qml define inline component -\snippet doc/snippets/qml/reusablecomponents/component.qml parent end +\snippet qml/reusablecomponents/component.qml parent begin +\snippet qml/reusablecomponents/component.qml define inline component +\snippet qml/reusablecomponents/component.qml parent end Components may incorporate any \l{Qt Quick}{QML feature} such as: @@ -89,7 +89,7 @@ A component defined in a \c .qml file is directly usable by declaring the name of the component. For example, a button defined in \c Button.qml is created by declaring a \c Button. The button is defined in the \l {qml-define-components}{Defining New Components} section. -\snippet doc/snippets/qml/reusablecomponents/application.qml document +\snippet qml/reusablecomponents/application.qml document Note that the component name, \c Button, matches the QML filename, \c Button.qml. Also, the first character is in upper case. Matching the names allow @@ -100,7 +100,7 @@ For flexibility, a \c qmldir file is for dictating which additional components, plugins, or directories should be imported. By using a \c qmldir file, component names do not need to match the filenames. The \c qmldir file should, however, be in an imported path. -\snippet doc/snippets/qml/reusablecomponents/qmldir document +\snippet qml/reusablecomponents/qmldir document \section2 Loading an Inline Component @@ -109,8 +109,8 @@ delayed. A component may be created during a MouseArea event or by using a \l Loader element. The component can create an object, which is addressable in a similar way as an \l {qml-id}{identifier}. Thus, the created object may have its bindings set and read like a normal QML object. -\snippet doc/snippets/qml/reusablecomponents/component.qml define inline component -\snippet doc/snippets/qml/reusablecomponents/component.qml create inline component +\snippet qml/reusablecomponents/component.qml define inline component +\snippet qml/reusablecomponents/component.qml create inline component \keyword qml-component-properties \section1 Component Properties @@ -140,11 +140,11 @@ Consider the Button component from the object is a \l Rectangle. When imported, the Button component will possess the Rectangle's properties, methods, signals, and any custom properties. -\snippet doc/snippets/qml/reusablecomponents/Button.qml parent begin -\snippet doc/snippets/qml/reusablecomponents/Button.qml ellipses -\snippet doc/snippets/qml/reusablecomponents/Button.qml properties -\snippet doc/snippets/qml/reusablecomponents/Button.qml ellipses -\snippet doc/snippets/qml/reusablecomponents/Button.qml parent end +\snippet qml/reusablecomponents/Button.qml parent begin +\snippet qml/reusablecomponents/Button.qml ellipses +\snippet qml/reusablecomponents/Button.qml properties +\snippet qml/reusablecomponents/Button.qml ellipses +\snippet qml/reusablecomponents/Button.qml parent end The Button's \c text alias is accessible from outside the component as well as the Rectangle's visual properties and signals such as \c x, \c y, \c anchors, @@ -156,7 +156,7 @@ children which is beneficial for certain types of interfaces. However, since \c FocusScopes are not visual elements, the visual properties of its child need to be exposed. -\snippet doc/snippets/qml/reusablecomponents/focusbutton.qml document +\snippet qml/reusablecomponents/focusbutton.qml document \keyword qml-id \section2 The Object Identifier @@ -165,7 +165,7 @@ Each QML object may be given a special unique identifier called an \c id. No other object within the same QML component (see \l{QML Documents}) can have the same \c id value. QML objects may then access an object using the \c id property. -\snippet doc/snippets/qml/properties.qml id property +\snippet qml/properties.qml id property A component may readily access its parent's properties by using the \c parent property. @@ -178,15 +178,15 @@ Note that an \c id must begin with a lower-case letter or an underscore. The Objects or Items declared within a component can be made accessible by binding their id to a property alias. -\snippet doc/snippets/qml/reusablecomponents/Button.qml parent begin -\snippet doc/snippets/qml/reusablecomponents/Button.qml object alias -\snippet doc/snippets/qml/reusablecomponents/Button.qml text -\snippet doc/snippets/qml/reusablecomponents/Button.qml parent end +\snippet qml/reusablecomponents/Button.qml parent begin +\snippet qml/reusablecomponents/Button.qml object alias +\snippet qml/reusablecomponents/Button.qml text +\snippet qml/reusablecomponents/Button.qml parent end The advantage of using an alias instead a property of type of the object is that the value of the alias cannot be overridden, and members of the object can be used in property bindings when declaring an instance of the component. -\snippet doc/snippets/qml/reusablecomponents/application.qml grouped property +\snippet qml/reusablecomponents/application.qml grouped property If a property of type \c Text was used instead of an alias in this instance there would be no guarantee that \c label would be initialized before the binding was attempted which would cause the binding to fail. diff --git a/src/qml/doc/src/qml/qmldocument.qdoc b/src/qml/doc/src/qml/qmldocument.qdoc index 89a5bbd57b..d1d4cc0524 100644 --- a/src/qml/doc/src/qml/qmldocument.qdoc +++ b/src/qml/doc/src/qml/qmldocument.qdoc @@ -36,7 +36,7 @@ from text data. Here is a simple QML document: -\snippet doc/snippets/qml/qml-documents/non-trivial.qml document +\snippet qml/qml-documents/non-trivial.qml document QML documents are always encoded in UTF-8 format. @@ -79,7 +79,7 @@ text property: \li application.qml \row -\li \snippet doc/snippets/qml/qml-documents/qmldocuments.qml document +\li \snippet qml/qml-documents/qmldocuments.qml document \li \qml import QtQuick 2.0 @@ -138,9 +138,9 @@ These final two examples perform identically to the original document. \table \row \li -\snippet doc/snippets/qml/qml-documents/inline-component.qml document +\snippet qml/qml-documents/inline-component.qml document \li -\snippet doc/snippets/qml/qml-documents/inline-text-component.qml document +\snippet qml/qml-documents/inline-text-component.qml document \endtable diff --git a/src/qml/doc/src/qml/qmllanguage-modules.qdoc b/src/qml/doc/src/qml/qmllanguage-modules.qdoc index d32ce10b65..b5c17a4e22 100644 --- a/src/qml/doc/src/qml/qmllanguage-modules.qdoc +++ b/src/qml/doc/src/qml/qmllanguage-modules.qdoc @@ -52,7 +52,7 @@ example, an \c import statement is required to use: An \c import statement includes the module name, and possibly a version number. This can be seen in the snippet commonly found at the top of QML files: -\snippet doc/snippets/qml/imports/qtquick-1.0.qml import +\snippet qml/imports/qtquick-1.0.qml import This imports version 1.0 of the "QtQuick" module into the global namespace. (The QML library itself must be imported to use any of the \l {QML Elements}, as they @@ -111,7 +111,7 @@ Window { Similarly, if the directory resided on a network source, it could be imported like this: -\snippet doc/snippets/qml/imports/network-imports.qml imports +\snippet qml/imports/network-imports.qml imports A located module can also be imported as a network resource if it has a \l{Writing a qmldir file}{qmldir file} in the directory that specifies the QML files @@ -161,7 +161,7 @@ path or network resource URL. When importing an installed module, an un-quoted URI is used, with a mandatory version number: -\snippet doc/snippets/qml/imports/installed-module.qml imports +\snippet qml/imports/installed-module.qml imports When a module is imported, the QML engine searches the QML import path for a matching module. The root directory of the module must contain a @@ -244,7 +244,7 @@ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart"); This allows the application's QML files to use the \c PieChart type by importing the declared \c Charts module: -\snippet doc/snippets/qml/imports/chart.qml import +\snippet qml/imports/chart.qml import For \l{QQmlExtensionPlugin}{QML plugins}, the module URI is automatically passed to QQmlExtensionPlugin::registerTypes(). This method @@ -252,12 +252,12 @@ can be reimplemented by the developer to register the necessary types for the mo \c registerTypes() implementation from the \l{declarative/cppextensions/plugins}{QML plugins} example: -\snippet examples/declarative/cppextensions/plugins/plugin.cpp plugin +\snippet examples/qml/cppextensions/plugins/plugin.cpp plugin Once the plugin is built and installed, and includes a \l{Writing a qmldir file}{qmldir file}, the module can be imported from QML, like this: -\snippet doc/snippets/qml/imports/timeexample.qml import +\snippet qml/imports/timeexample.qml import Unlike QML types defined by QML files, a QML type defined in a C++ extension plugin cannot be loaded by a module that is imported as a network resource. @@ -271,15 +271,15 @@ By default, when a module is imported, its contents are imported into the global To import a module into a specific namespace, use the \e as keyword: -\snippet doc/snippets/qml/imports/named-imports.qml imports +\snippet qml/imports/named-imports.qml imports Types from these modules can then only be used when qualified by the namespace: -\snippet doc/snippets/qml/imports/named-imports.qml imported items +\snippet qml/imports/named-imports.qml imported items Multiple modules can be imported into the same namespace in the same way that multiple modules can be imported into the global namespace: -\snippet doc/snippets/qml/imports/merged-named-imports.qml imports +\snippet qml/imports/merged-named-imports.qml imports \section2 JavaScript Files diff --git a/src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc b/src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc index 59efab867f..a23dc129aa 100644 --- a/src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc +++ b/src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc @@ -58,9 +58,9 @@ Attempting to declare two signals or methods with the same name in the same type block generates an error. However, a new signal may reuse the name of an existing signal on the type. (This should be done with caution, as the existing signal may be hidden and become inaccessible.) Here are various examples of signal declarations: -\snippet doc/snippets/qml/events.qml parent begin -\snippet doc/snippets/qml/events.qml signal declaration -\snippet doc/snippets/qml/events.qml parent end +\snippet qml/events.qml parent begin +\snippet qml/events.qml signal declaration +\snippet qml/events.qml parent end If the signal has no parameters, the "\c{()}" brackets are optional. If parameters are used, the parameter types must be declared, as for the \c string @@ -69,17 +69,17 @@ and \c variant arguments of the \c perform signal. Adding a signal to an item automatically adds a \e{signal handler} as well. The signal hander is named \c on<SignalName>, with the first letter of the signal in uppercase. The previous signals have the following signal handlers: -\snippet doc/snippets/qml/events.qml signal handler declaration +\snippet qml/events.qml signal handler declaration Further, each QML properties have a \c{<property_name>Changed} signal and its corresponding \c{on<property_name>Changed} signal handler. As a result, property changes may notify other components for any changes. -\snippet doc/snippets/qml/events.qml automatic signals +\snippet qml/events.qml automatic signals To emit a signal, invoke it as a method. The signal handler binding is similar to a property binding and it is invoked when the signal is emitted. Use the defined argument names to access the respective arguments. -\snippet doc/snippets/qml/events.qml signal emit +\snippet qml/events.qml signal emit Note that the \c Component.onCompleted is an \l{attached-signalhandlers}{attached signal handler}; it is invoked when the \l Component initialization is complete. @@ -93,7 +93,7 @@ automatically invoked whenever the signal is emitted. This mechanism enables a signal to be received by a method instead of a \l {Signal Handlers}{signal handler}. -\snippet doc/snippets/qml/events.qml connect method +\snippet qml/events.qml connect method The \c {connect()} method is appropriate when connecting a JavaScript method to a signal. @@ -104,7 +104,7 @@ signals. By connecting signals to other signals, the \c connect() method can form different signal chains. -\snippet doc/snippets/qml/events.qml forward signal +\snippet qml/events.qml forward signal Whenever the \l MouseArea \c clicked signal is emitted, the \c send diff --git a/src/qml/doc/src/qmlsyntax.qdoc b/src/qml/doc/src/qmlsyntax.qdoc index 1814b16078..b6b9051c5c 100644 --- a/src/qml/doc/src/qmlsyntax.qdoc +++ b/src/qml/doc/src/qmlsyntax.qdoc @@ -133,7 +133,7 @@ Commenting in QML is similar to JavaScript. \li Multiline comments start with /* and finish with *\/ \endlist -\snippet doc/snippets/qml/comments.qml 0 +\snippet qml/comments.qml 0 Comments are ignored by the engine. They are useful for explaining what you are doing; for referring back to at a later date, or for others reading diff --git a/src/qml/doc/src/tutorials/extending-tutorial.qdoc b/src/qml/doc/src/tutorials/extending-tutorial.qdoc index b5958d9d43..31f3299479 100644 --- a/src/qml/doc/src/tutorials/extending-tutorial.qdoc +++ b/src/qml/doc/src/tutorials/extending-tutorial.qdoc @@ -39,17 +39,17 @@ core QML features, including properties, signals and bindings. It also shows how extensions can be deployed through plugins. You can find the source code for this tutorial in \c Qt's -examples/declarative/tutorials/extending directory. +examples/quick/tutorials/extending directory. Tutorial chapters: \list 1 -\li \l{declarative/tutorials/extending/chapter1-basics}{Creating a New Type} -\li \l{declarative/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals} -\li \l{declarative/tutorials/extending/chapter3-bindings}{Property Binding} -\li \l{declarative/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types} -\li \l{declarative/tutorials/extending/chapter5-listproperties}{Using List Property Types} -\li \l{declarative/tutorials/extending/chapter6-plugins}{Writing an Extension Plugin} +\li \l{examples/tutorials/extending/chapter1-basics}{Creating a New Type} +\li \l{examples/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals} +\li \l{examples/tutorials/extending/chapter3-bindings}{Property Binding} +\li \l{examples/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types} +\li \l{examples/tutorials/extending/chapter5-listproperties}{Using List Property Types} +\li \l{examples/tutorials/extending/chapter6-plugins}{Writing an Extension Plugin} \li \l{qml-extending-tutorial7.html}{In Summary} \endlist @@ -58,7 +58,7 @@ Tutorial chapters: /*! \title Chapter 1: Creating a New Type -\example declarative/tutorials/extending/chapter1-basics +\example examples/tutorials/extending/chapter1-basics A common task when extending QML is to provide a new QML type that supports some custom functionality beyond what is provided by the built-in \l {QML Elements}. @@ -98,7 +98,7 @@ this new class must: Here is our \c PieChart class, defined in \c piechart.h: -\snippet declarative/tutorials/extending/chapter1-basics/piechart.h 0 +\snippet examples/tutorials/extending/chapter1-basics/piechart.h 0 The class inherits from QQuickItem because we want to override QQuickItem::paint() in order to draw. If the class just represented some @@ -112,15 +112,15 @@ simply sets and returns the \c m_name and \c m_color values as appropriate, and implements \c paint() to draw a simple pie chart. It also turns off the QGraphicsItem::ItemHasNoContents flag to enable painting: -\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 0 +\snippet examples/tutorials/extending/chapter1-basics/piechart.cpp 0 \dots 0 -\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 1 +\snippet examples/tutorials/extending/chapter1-basics/piechart.cpp 1 Now that we have defined the \c PieChart type, we will use it from QML. The \c app.qml file creates a \c PieChart item and display the pie chart's details using a standard QML \l Text item: -\snippet declarative/tutorials/extending/chapter1-basics/app.qml 0 +\snippet examples/tutorials/extending/chapter1-basics/app.qml 0 Notice that although the color is specified as a string in QML, it is automatically converted to a QColor object for the PieChart \c color property. Automatic conversions are @@ -134,14 +134,14 @@ you don't register the type, \c app.qml won't be able to create a \c PieChart. Here is the application \c main.cpp: -\snippet declarative/tutorials/extending/chapter1-basics/main.cpp 0 +\snippet examples/tutorials/extending/chapter1-basics/main.cpp 0 This call to qmlRegisterType() registers the \c PieChart type as a type called "PieChart", in a module named "Charts", with a module version of 1.0. Lastly, we write a \c .pro project file that includes the files and the \c declarative library: -\quotefile declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro +\quotefile examples/tutorials/extending/chapter1-basics/chapter1-basics.pro Now we can build and run the application: @@ -160,26 +160,26 @@ Later on, we'll show how to create a plugin so that you can run \c app.qml using /*! \title Chapter 2: Connecting to C++ Methods and Signals -\example declarative/tutorials/extending/chapter2-methods +\example examples/tutorials/extending/chapter2-methods Suppose we want \c PieChart to have a "clearChart()" method that erases the chart and then emits a "chartCleared" signal. Our \c app.qml would be able to call \c clearChart() and receive \c chartCleared() signals like this: -\snippet declarative/tutorials/extending/chapter2-methods/app.qml 0 +\snippet examples/tutorials/extending/chapter2-methods/app.qml 0 \image extending-tutorial-chapter2.png To do this, we add a \c clearChart() method and a \c chartCleared() signal to our C++ class: -\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 0 +\snippet examples/tutorials/extending/chapter2-methods/piechart.h 0 \dots -\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 1 +\snippet examples/tutorials/extending/chapter2-methods/piechart.h 1 \dots -\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 2 +\snippet examples/tutorials/extending/chapter2-methods/piechart.h 2 \dots -\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 3 +\snippet examples/tutorials/extending/chapter2-methods/piechart.h 3 The use of Q_INVOKABLE makes the \c clearChart() method available to the Qt Meta-Object system, and in turn, to QML. Note that it could have @@ -189,7 +189,7 @@ slots are also callable from QML. Both of these approaches are valid. The \c clearChart() method simply changes the color to Qt::transparent, repaints the chart, then emits the \c chartCleared() signal: -\snippet declarative/tutorials/extending/chapter2-methods/piechart.cpp 0 +\snippet examples/tutorials/extending/chapter2-methods/piechart.cpp 0 Now when we run the application and click the window, the pie chart disappears, and the application outputs: @@ -205,7 +205,7 @@ Try out the example yourself with the updated code in Qt's \c examples/tutorials /*! \title Chapter 3: Adding Property Bindings -\example declarative/tutorials/extending/chapter3-bindings +\example examples/tutorials/extending/chapter3-bindings Property binding is a powerful feature of QML that allows values of different elements to be synchronized automatically. It uses signals to notify and update @@ -214,7 +214,7 @@ other elements' values when property values are changed. Let's enable property bindings for the \c color property. That means if we have code like this: -\snippet declarative/tutorials/extending/chapter3-bindings/app.qml 0 +\snippet examples/tutorials/extending/chapter3-bindings/app.qml 0 \image extending-tutorial-chapter3.png @@ -229,17 +229,17 @@ It's easy to enable property binding for the \c color property. We add a \l{Qt's Property System}{NOTIFY} feature to its Q_PROPERTY() declaration to indicate that a "colorChanged" signal is emitted whenever the value changes. -\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 0 +\snippet examples/tutorials/extending/chapter3-bindings/piechart.h 0 \dots -\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 1 +\snippet examples/tutorials/extending/chapter3-bindings/piechart.h 1 \dots -\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 2 +\snippet examples/tutorials/extending/chapter3-bindings/piechart.h 2 \dots -\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 3 +\snippet examples/tutorials/extending/chapter3-bindings/piechart.h 3 Then, we emit this signal in \c setPieSlice(): -\snippet declarative/tutorials/extending/chapter3-bindings/piechart.cpp 0 +\snippet examples/tutorials/extending/chapter3-bindings/piechart.cpp 0 It's important for \c setColor() to check that the color value has actually changed before emitting \c colorChanged(). This ensures the signal is not emitted unnecessarily and @@ -257,7 +257,7 @@ custom QML types may see unexpected behavior if bindings are not implemented. /*! \title Chapter 4: Using Custom Property Types -\example declarative/tutorials/extending/chapter4-customPropertyTypes +\example examples/tutorials/extending/chapter4-customPropertyTypes The \c PieChart type currently has a string-type property and a color-type property. It could have many other types of properties. For example, it could have an @@ -304,41 +304,41 @@ For example, let's replace the use of the \c property with a type called "PieSlice" that has a \c color property. Instead of assigning a color, we assign an \c PieSlice value which itself contains a \c color: -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml 0 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/app.qml 0 Like \c PieChart, this new \c PieSlice type inherits from QQuickItem and declares its properties with Q_PROPERTY(): -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0 To use it in \c PieChart, we modify the \c color property declaration and associated method signatures: -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 0 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/piechart.h 0 \dots -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 1 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/piechart.h 1 \dots -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 2 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/piechart.h 2 \dots -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 3 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/piechart.h 3 There is one thing to be aware of when implementing \c setPieSlice(). The \c PieSlice is a visual item, so it must be set as a child of the \c PieChart using QQuickItem::setParentItem() so that the \c PieChart knows to paint this child item when its contents are drawn: -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0 Like the \c PieChart type, the \c PieSlice type has to be registered using qmlRegisterType() to be used from QML. As with \c PieChart, we'll add the type to the "Charts" module, version 1.0: -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 0 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/main.cpp 0 \dots -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 1 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/main.cpp 1 \dots -\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 2 +\snippet examples/tutorials/extending/chapter4-customPropertyTypes/main.cpp 2 Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-customPropertyTypes directory. @@ -348,13 +348,13 @@ Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-custom /*! \title Chapter 5: Using List Property Types -\example declarative/tutorials/extending/chapter5-listproperties +\example examples/tutorials/extending/chapter5-listproperties Right now, a \c PieChart can only have one \c PieSlice. Ideally a chart would have multiple slices, with different colors and sizes. To do this, we could have a \c slices property that accepts a list of \c PieSlice items: -\snippet declarative/tutorials/extending/chapter5-listproperties/app.qml 0 +\snippet examples/tutorials/extending/chapter5-listproperties/app.qml 0 \image extending-tutorial-chapter5.png @@ -365,11 +365,11 @@ function with a \c slices() function that returns a list of slices, and add an internal \c append_slice() function (discussed below). We also use a QList to store the internal list of slices as \c m_slices: -\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 0 +\snippet examples/tutorials/extending/chapter5-listproperties/piechart.h 0 \dots -\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 1 +\snippet examples/tutorials/extending/chapter5-listproperties/piechart.h 1 \dots -\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 2 +\snippet examples/tutorials/extending/chapter5-listproperties/piechart.h 2 Although the \c slices property does not have an associated \c WRITE function, it is still modifiable because of the way QQmlListProperty works. @@ -378,7 +378,7 @@ return a QQmlListProperty value and indicate that the internal \c PieChart::append_slice() function is to be called whenever a request is made from QML to add items to the list: -\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.cpp 0 +\snippet examples/tutorials/extending/chapter5-listproperties/piechart.cpp 0 The \c append_slice() function simply sets the parent item as before, and adds the new item to the \c m_slices list. As you can see, the append function for a @@ -397,7 +397,7 @@ The complete code can be seen in the updated \c examples/tutorials/extending/cha /*! \title Chapter 6: Writing an Extension Plugin -\example declarative/tutorials/extending/chapter6-plugins +\example examples/tutorials/extending/chapter6-plugins Currently the \c PieChart and \c PieSlice types are used by \c app.qml, which is displayed using a QQuickView in a C++ application. An alternative @@ -420,22 +420,22 @@ Q_EXPORT_PLUGIN2 for Qt's \l{How to Create Qt Plugins}{plugin system}. Here is the \c ChartsPlugin definition in \c chartsplugin.h: -\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.h 0 +\snippet examples/tutorials/extending/chapter6-plugins/chartsplugin.h 0 And its implementation in \c chartsplugin.cpp: -\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp 0 +\snippet examples/tutorials/extending/chapter6-plugins/chartsplugin.cpp 0 Then, we write a \c .pro project file that defines the project as a plugin library and specifies with DESTDIR that library files should be built into a "lib" subdirectory: -\quotefile declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro +\quotefile examples/tutorials/extending/chapter6-plugins/chapter6-plugins.pro Finally, we add a \l{Writing a qmldir file}{qmldir} file that is automatically parsed by the QML engine. In this file, we specify that a plugin named "chapter6-plugin" (the name of the example project) can be found in the "lib" subdirectory: -\quotefile declarative/tutorials/extending/chapter6-plugins/qmldir +\quotefile examples/tutorials/extending/chapter6-plugins/ChartsPlugin/qmldir Now we have a plugin, and instead of having a main.cpp and an executable, we can build the project and then load the QML file in the \l {QML Viewer}: diff --git a/src/qml/qml/ftw/qintrusivelist.cpp b/src/qml/qml/ftw/qintrusivelist.cpp index 5a1624f1f4..4a4b131c9c 100644 --- a/src/qml/qml/ftw/qintrusivelist.cpp +++ b/src/qml/qml/ftw/qintrusivelist.cpp @@ -147,7 +147,7 @@ Returns an STL-style iterator pointing to the imaginary item after the last item */ /*! -iterator &QInplacelist::iterator::erase() +\fn iterator &QInplacelist::iterator::erase() Remove the current object from the list, and return an iterator to the next element. */ diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 1ade6988f7..d31b4d4773 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -205,7 +205,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject) For example, here is a component that is used by multiple \l Loader objects. It contains a single item, a \l Rectangle: - \snippet doc/snippets/qml/component.qml 0 + \snippet qml/component.qml 0 Notice that while a \l Rectangle by itself would be automatically rendered and displayed, this is not the case for the above rectangle diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index beaa6d78dc..6b1c869ee8 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -120,7 +120,7 @@ void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor) It can be useful to create a QtObject if you need an extremely lightweight element to enclose a set of custom properties: - \snippet doc/snippets/qml/qtobject.qml 0 + \snippet qml/qtobject.qml 0 It can also be useful for C++ integration, as it is just a plain QObject. See the QObject documentation for further details. @@ -360,7 +360,7 @@ The following functions are also on the Qt object. The following example uses the \c application object to indicate whether the application is currently active: - \snippet doc/snippets/qml/application.qml document + \snippet qml/application.qml document */ /*! diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp index 73d74f9e21..667e50a6bf 100644 --- a/src/qml/qml/qqmlextensionplugin.cpp +++ b/src/qml/qml/qqmlextensionplugin.cpp @@ -110,12 +110,12 @@ QT_BEGIN_NAMESPACE should be bundled with the plugin, so it needs to be specified in the \c qmldir file: - \quotefile examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir + \quotefile examples/qml/cppextensions/plugins/com/nokia/TimeExample/qmldir Once the project is built and installed, the new \c Time element can be used by any QML component that imports the \c com.nokia.TimeExample module: - \snippet examples/declarative/cppextensions/plugins/plugins.qml 0 + \snippet examples/qml/cppextensions/plugins/plugins.qml 0 The full source code is available in the \l {declarative/cppextensions/plugins}{plugins example}. diff --git a/src/qml/qml/qquicklistmodel.cpp b/src/qml/qml/qquicklistmodel.cpp index 389394652a..8e1155bae8 100644 --- a/src/qml/qml/qquicklistmodel.cpp +++ b/src/qml/qml/qquicklistmodel.cpp @@ -1380,7 +1380,7 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in \inlineimage listmodel.png \enddiv - \snippet doc/snippets/qml/listmodel.qml 0 + \snippet qml/listmodel/listmodel.qml 0 Roles (properties) in each element must begin with a lower-case letter and should be common to all elements in a model. The ListElement documentation @@ -1389,14 +1389,14 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in Since the example model contains an \c id property, it can be referenced by views, such as the ListView in this example: - \snippet doc/snippets/qml/listmodel-simple.qml 0 + \snippet qml/listmodel/listmodel-simple.qml 0 \dots 8 - \snippet doc/snippets/qml/listmodel-simple.qml 1 + \snippet qml/listmodel/listmodel-simple.qml 1 It is possible for roles to contain list data. In the following example we create a list of fruit attributes: - \snippet doc/snippets/qml/listmodel-nested.qml model + \snippet qml/listmodel/listmodel-nested.qml model The delegate displays all the fruit attributes: @@ -1404,14 +1404,14 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in \inlineimage listmodel-nested.png \enddiv - \snippet doc/snippets/qml/listmodel-nested.qml delegate + \snippet qml/listmodel/listmodel-nested.qml delegate \section1 Modifying List Models The content of a ListModel may be created and modified using the clear(), append(), set(), insert() and setProperty() methods. For example: - \snippet doc/snippets/qml/listmodel-modify.qml delegate + \snippet qml/listmodel/listmodel-modify.qml delegate Note that when creating content dynamically the set of available properties cannot be changed once set. Whatever properties are first added to the model @@ -1427,11 +1427,11 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in Here is an example that uses WorkerScript to periodically append the current time to a list model: - \snippet examples/declarative/threading/threadedlistmodel/timedisplay.qml 0 + \snippet examples/quick/threading/threadedlistmodel/timedisplay.qml 0 The included file, \tt dataloader.js, looks like this: - \snippet examples/declarative/threading/threadedlistmodel/dataloader.js 0 + \snippet examples/quick/threading/threadedlistmodel/dataloader.js 0 The timer in the main example sends messages to the worker script by calling \l WorkerScript::sendMessage(). When this message is received, @@ -2456,12 +2456,12 @@ bool QQuickListModelParser::definesEmptyList(const QString &s) The following model defines a series of list elements, each of which contain "name" and "cost" roles and their associated values. - \snippet doc/snippets/qml/qml-data-models/listelements.qml model + \snippet qml/listmodel/listelements.qml model The delegate obtains the name and cost for each element by simply referring to \c name and \c cost: - \snippet doc/snippets/qml/qml-data-models/listelements.qml view + \snippet qml/listmodel/listelements.qml view \sa ListModel */ diff --git a/src/qml/qml/qquickworkerscript.cpp b/src/qml/qml/qquickworkerscript.cpp index 81ebb1fed4..53eb60eab3 100644 --- a/src/qml/qml/qquickworkerscript.cpp +++ b/src/qml/qml/qquickworkerscript.cpp @@ -574,12 +574,12 @@ void QQuickWorkerScriptEngine::run() An example: - \snippet doc/snippets/qml/workerscript.qml 0 + \snippet qml/workerscript/workerscript.qml 0 The above worker script specifies a JavaScript file, "script.js", that handles the operations to be performed in the new thread. Here is \c script.js: - \quotefile doc/src/snippets/qml/script.js + \quotefile qml/workerscript/script.js When the user clicks anywhere within the rectangle, \c sendMessage() is called, triggering the \tt WorkerScript.onMessage() handler in diff --git a/src/qml/qml/v8/qjsengine.cpp b/src/qml/qml/v8/qjsengine.cpp index 03cd51eab9..080540eeef 100644 --- a/src/qml/qml/v8/qjsengine.cpp +++ b/src/qml/qml/v8/qjsengine.cpp @@ -84,7 +84,7 @@ Q_DECLARE_METATYPE(QList<int>) Use evaluate() to evaluate script code. - \snippet doc/snippets/code/src_script_qjsengine.cpp 0 + \snippet code/src_script_qjsengine.cpp 0 evaluate() returns a QJSValue that holds the result of the evaluation. The QJSValue class provides functions for converting @@ -94,13 +94,13 @@ Q_DECLARE_METATYPE(QList<int>) The following code snippet shows how a script function can be defined and then invoked from C++ using QJSValue::call(): - \snippet doc/snippets/code/src_script_qjsengine.cpp 1 + \snippet code/src_script_qjsengine.cpp 1 As can be seen from the above snippets, a script is provided to the engine in the form of a string. One common way of loading scripts is by reading the contents of a file and passing it to evaluate(): - \snippet doc/snippets/code/src_script_qjsengine.cpp 2 + \snippet code/src_script_qjsengine.cpp 2 Here we pass the name of the file as the second argument to evaluate(). This does not affect evaluation in any way; the second @@ -116,7 +116,7 @@ Q_DECLARE_METATYPE(QList<int>) want to configure a script engine by adding one or more properties to the Global Object: - \snippet doc/snippets/code/src_script_qjsengine.cpp 3 + \snippet code/src_script_qjsengine.cpp 3 Adding custom properties to the scripting environment is one of the standard means of providing a scripting API that is specific to your @@ -132,7 +132,7 @@ Q_DECLARE_METATYPE(QList<int>) value. If isError() returns true, you can call toString() on the error object to obtain an error message. - \snippet doc/snippets/code/src_script_qjsengine.cpp 4 + \snippet code/src_script_qjsengine.cpp 4 \section1 Script Object Creation @@ -150,7 +150,7 @@ Q_DECLARE_METATYPE(QList<int>) properties of the proxy object. No binding code is needed because it is done dynamically using the Qt meta object system. - \snippet doc/snippets/code/src_script_qjsengine.cpp 5 + \snippet code/src_script_qjsengine.cpp 5 \sa QJSValue, {Making Applications Scriptable} diff --git a/src/qml/qml/v8/qjsvalue.cpp b/src/qml/qml/v8/qjsvalue.cpp index 58732f2df8..514572ca71 100644 --- a/src/qml/qml/v8/qjsvalue.cpp +++ b/src/qml/qml/v8/qjsvalue.cpp @@ -77,7 +77,7 @@ QJSValues. Use setProperty() to set a property of an object, and call property() to retrieve the value of a property. - \snippet doc/snippets/code/src_script_qjsvalue.cpp 0 + \snippet code/src_script_qjsvalue.cpp 0 If you want to iterate over the properties of a script object, use the QJSValueIterator class. diff --git a/src/qml/qml/v8/qjsvalueiterator.cpp b/src/qml/qml/v8/qjsvalueiterator.cpp index 921d359f4e..6be892a40e 100644 --- a/src/qml/qml/v8/qjsvalueiterator.cpp +++ b/src/qml/qml/v8/qjsvalueiterator.cpp @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE beginning of the sequence of properties. Here's how to iterate over all the properties of a QJSValue: - \snippet doc/snippets/code/src_script_qjsvalueiterator.cpp 0 + \snippet code/src_script_qjsvalueiterator.cpp 0 The next() advances the iterator. The name() and value() functions return the name and value of the last item that was @@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE own properties; i.e. it does not follow the prototype chain. You can use a loop like this to follow the prototype chain: - \snippet doc/snippets/code/src_script_qjsvalueiterator.cpp 1 + \snippet code/src_script_qjsvalueiterator.cpp 1 \sa QJSValue::property() */ diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index f6c7a5969d..787197d1d7 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -978,7 +978,7 @@ If \a filepath is specified, it will be used for error reporting for the created Example (where \c parentItem is the id of an existing QML item): -\snippet doc/snippets/qml/createQmlObject.qml 0 +\snippet qml/createQmlObject.qml 0 In the case of an error, a QtScript Error object is thrown. This object has an additional property, \c qmlErrors, which is an array of the errors encountered. @@ -1109,7 +1109,7 @@ component to create an object instance of the component. For example: -\snippet doc/snippets/qml/createComponent-simple.qml 0 +\snippet qml/createComponent-simple.qml 0 See \l {Dynamic Object Management in QML} for more information on using this function. @@ -1329,20 +1329,20 @@ v8::Handle<v8::Value> locale(const v8::Arguments &args) There are two main use-cases for the function: firstly, in imperative JavaScript code to cause a binding assignment: - \snippet doc/snippets/declarative/qtBinding.1.qml 0 + \snippet qml/qtBinding.1.qml 0 and secondly, when defining initial property values of dynamically constructed objects (via Component.createObject() or Loader.setSource()) as being bound to the result of an expression. For example, assuming the existence of a DynamicText component: - \snippet doc/snippets/declarative/DynamicText.qml 0 + \snippet qml/DynamicText.qml 0 the output from: - \snippet doc/snippets/declarative/qtBinding.2.qml 0 + \snippet qml/qtBinding.2.qml 0 and from: - \snippet doc/snippets/declarative/qtBinding.3.qml 0 + \snippet qml/qtBinding.3.qml 0 should both be: \code @@ -1357,7 +1357,7 @@ v8::Handle<v8::Value> locale(const v8::Arguments &args) declarations and binding assignments}) except when the result is stored in an array bound to a var property. - \snippet doc/snippets/declarative/qtBinding.4.qml 0 + \snippet qml/qtBinding.4.qml 0 Note: in QtQuick 1.x, all function assignment was treated as binding assignment, so the Qt.binding() function is new in |