From 229105ba89d4c90cc6e8bf99eaf9957bead317d8 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 14 Jan 2013 17:44:23 +0100 Subject: QmlDesigner: adding manual test files for Qt Quick 2.0 Change-Id: I44d3a4165d1ff12488bcc63f19765bc7cf91bc18 Reviewed-by: Robert Loehning --- .../qml/testfiles_quick2/components/MyButton.qml | 36 ++++ tests/manual/qml/testfiles_quick2/empty.qml | 35 ++++ tests/manual/qml/testfiles_quick2/flipable.qml | 42 +++++ tests/manual/qml/testfiles_quick2/helloworld.qml | 40 ++++ .../qml/testfiles_quick2/helloworld_inverted.qml | 42 +++++ tests/manual/qml/testfiles_quick2/images.qml | 56 ++++++ .../qml/testfiles_quick2/images/qtcreator.ico | Bin 0 -> 34108 bytes .../qml/testfiles_quick2/images/qtcreator.jpg | Bin 0 -> 10129 bytes .../qml/testfiles_quick2/images/qtcreator.png | Bin 0 -> 15801 bytes tests/manual/qml/testfiles_quick2/listmodel.qml | 39 ++++ tests/manual/qml/testfiles_quick2/listview.qml | 73 +++++++ tests/manual/qml/testfiles_quick2/positioners.qml | 209 +++++++++++++++++++++ tests/manual/qml/testfiles_quick2/states.qml | 73 +++++++ tests/manual/qml/testfiles_quick2/subcomponent.qml | 46 +++++ .../testfiles_quick2/testfiles_quick2.qmlproject | 14 ++ tests/manual/qml/testfiles_quick2/usingbutton.qml | 40 ++++ tests/manual/qml/testfiles_quick2/views.qml | 198 +++++++++++++++++++ 17 files changed, 943 insertions(+) create mode 100644 tests/manual/qml/testfiles_quick2/components/MyButton.qml create mode 100644 tests/manual/qml/testfiles_quick2/empty.qml create mode 100644 tests/manual/qml/testfiles_quick2/flipable.qml create mode 100644 tests/manual/qml/testfiles_quick2/helloworld.qml create mode 100644 tests/manual/qml/testfiles_quick2/helloworld_inverted.qml create mode 100644 tests/manual/qml/testfiles_quick2/images.qml create mode 100644 tests/manual/qml/testfiles_quick2/images/qtcreator.ico create mode 100644 tests/manual/qml/testfiles_quick2/images/qtcreator.jpg create mode 100644 tests/manual/qml/testfiles_quick2/images/qtcreator.png create mode 100644 tests/manual/qml/testfiles_quick2/listmodel.qml create mode 100644 tests/manual/qml/testfiles_quick2/listview.qml create mode 100644 tests/manual/qml/testfiles_quick2/positioners.qml create mode 100644 tests/manual/qml/testfiles_quick2/states.qml create mode 100644 tests/manual/qml/testfiles_quick2/subcomponent.qml create mode 100644 tests/manual/qml/testfiles_quick2/testfiles_quick2.qmlproject create mode 100644 tests/manual/qml/testfiles_quick2/usingbutton.qml create mode 100644 tests/manual/qml/testfiles_quick2/views.qml diff --git a/tests/manual/qml/testfiles_quick2/components/MyButton.qml b/tests/manual/qml/testfiles_quick2/components/MyButton.qml new file mode 100644 index 0000000000..0aa1b1b09e --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/components/MyButton.qml @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 64 + height: 48 + color: "Red" +} diff --git a/tests/manual/qml/testfiles_quick2/empty.qml b/tests/manual/qml/testfiles_quick2/empty.qml new file mode 100644 index 0000000000..35e165eb5d --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/empty.qml @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 640 + height: 480 +} diff --git a/tests/manual/qml/testfiles_quick2/flipable.qml b/tests/manual/qml/testfiles_quick2/flipable.qml new file mode 100644 index 0000000000..e841a33736 --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/flipable.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Flipable { + width: 640 + height: 480 + front: Text { + text: "front" + } + back: Text { + text: "back" + } + +} diff --git a/tests/manual/qml/testfiles_quick2/helloworld.qml b/tests/manual/qml/testfiles_quick2/helloworld.qml new file mode 100644 index 0000000000..c1ab8bb3b1 --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/helloworld.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 200 + height: 200 + Text { + x: 66 + y: 93 + text: "Hello World" + } +} diff --git a/tests/manual/qml/testfiles_quick2/helloworld_inverted.qml b/tests/manual/qml/testfiles_quick2/helloworld_inverted.qml new file mode 100644 index 0000000000..90c741da41 --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/helloworld_inverted.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 200 + height: 200 + color: "black" + Text { + x: 66 + y: 93 + text: "Hello World" + color: "white" + } +} diff --git a/tests/manual/qml/testfiles_quick2/images.qml b/tests/manual/qml/testfiles_quick2/images.qml new file mode 100644 index 0000000000..8a45b2b173 --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/images.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 640 + height: 480 + + Image { + id: image1 + x: 20 + y: 18 + source: "images/qtcreator.png" + } + + Image { + id: image2 + x: 327 + y: 18 + source: "images/qtcreator.jpg" + } + + Image { + id: image3 + x: 20 + y: 288 + source: "images/qtcreator.ico" + } +} diff --git a/tests/manual/qml/testfiles_quick2/images/qtcreator.ico b/tests/manual/qml/testfiles_quick2/images/qtcreator.ico new file mode 100644 index 0000000000..6bca2585a6 Binary files /dev/null and b/tests/manual/qml/testfiles_quick2/images/qtcreator.ico differ diff --git a/tests/manual/qml/testfiles_quick2/images/qtcreator.jpg b/tests/manual/qml/testfiles_quick2/images/qtcreator.jpg new file mode 100644 index 0000000000..d856c51b43 Binary files /dev/null and b/tests/manual/qml/testfiles_quick2/images/qtcreator.jpg differ diff --git a/tests/manual/qml/testfiles_quick2/images/qtcreator.png b/tests/manual/qml/testfiles_quick2/images/qtcreator.png new file mode 100644 index 0000000000..1cf9f91170 Binary files /dev/null and b/tests/manual/qml/testfiles_quick2/images/qtcreator.png differ diff --git a/tests/manual/qml/testfiles_quick2/listmodel.qml b/tests/manual/qml/testfiles_quick2/listmodel.qml new file mode 100644 index 0000000000..667b671dd5 --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/listmodel.qml @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +ListModel { + id: myModel + ListElement { + content: "foo" + text: "bar" + } + +} diff --git a/tests/manual/qml/testfiles_quick2/listview.qml b/tests/manual/qml/testfiles_quick2/listview.qml new file mode 100644 index 0000000000..f3cbeb2a84 --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/listview.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + width: 200 + height: 100 + + ListView { + anchors.fill: parent; + model: ListModel { + ListElement { + name: "BMW" + speed: 200 + } + ListElement { + name: "Mercedes" + speed: 180 + } + ListElement { + name: "Audi" + speed: 190 + } + ListElement { + name: "VW" + speed: 180 + } + } + + + delegate: Item { + height: 40 + Row { + spacing: 10 + Text { + text: name; + font.bold: true + } + + Text { text: "speed: " + speed } + } + + + } + } +} diff --git a/tests/manual/qml/testfiles_quick2/positioners.qml b/tests/manual/qml/testfiles_quick2/positioners.qml new file mode 100644 index 0000000000..c7abfd4ac8 --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/positioners.qml @@ -0,0 +1,209 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 232 + height: 232 + + Column { + id: column + x: 39 + y: 20 + spacing: 2 + + Rectangle { + width: 20 + height: 20 + color: "#c2d11b" + } + + Rectangle { + width: 20 + height: 20 + color: "#d11b1b" + } + + Rectangle { + width: 20 + height: 20 + color: "#1e3fd3" + } + + Rectangle { + width: 20 + height: 20 + color: "#3bd527" + } + + Rectangle { + width: 20 + height: 20 + color: "#8726b7" + } + + Rectangle { + width: 20 + height: 20 + color: "#8b8b8b" + } + } + + Row { + id: row + x: 78 + y: 20 + Rectangle { + width: 20 + height: 20 + color: "#c2d11b" + } + + Rectangle { + width: 20 + height: 20 + color: "#d11b1b" + } + + Rectangle { + width: 20 + height: 20 + color: "#1e3fd3" + } + + Rectangle { + width: 20 + height: 20 + color: "#3bd527" + } + + Rectangle { + width: 20 + height: 20 + color: "#8726b7" + } + + Rectangle { + width: 20 + height: 20 + color: "#8b8b8b" + } + spacing: 2 + } + + Flow { + id: flow + x: 78 + y: 53 + width: 84 + height: 31 + + Rectangle { + width: 20 + height: 20 + color: "#c2d11b" + } + + Rectangle { + width: 20 + height: 20 + color: "#d11b1b" + } + + Rectangle { + width: 20 + height: 20 + color: "#1e3fd3" + } + + Rectangle { + width: 20 + height: 20 + color: "#3bd527" + } + + Rectangle { + width: 20 + height: 20 + color: "#8726b7" + } + + Rectangle { + width: 20 + height: 20 + color: "#8b8b8b" + } + spacing: 2 + } + + Grid { + id: grid + x: 78 + y: 108 + columns: 3 + Rectangle { + width: 20 + height: 20 + color: "#c2d11b" + } + + Rectangle { + width: 20 + height: 20 + color: "#d11b1b" + } + + Rectangle { + width: 20 + height: 20 + color: "#1e3fd3" + } + + Rectangle { + width: 20 + height: 20 + color: "#3bd527" + } + + Rectangle { + width: 20 + height: 20 + color: "#8726b7" + } + + spacing: 2 + Rectangle { + width: 20 + height: 20 + color: "#8b8b8b" + } + } + +} diff --git a/tests/manual/qml/testfiles_quick2/states.qml b/tests/manual/qml/testfiles_quick2/states.qml new file mode 100644 index 0000000000..3b39eedb5a --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/states.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: rect + width: 200 + height: 200 + Text { + id: text + x: 66 + y: 93 + text: "Base State" + } + states: [ + State { + name: "State1" + PropertyChanges { + target: rect + color: "blue" + } + PropertyChanges { + target: text + text: "State1" + } + }, + State { + name: "State2" + PropertyChanges { + target: rect + color: "gray" + } + PropertyChanges { + target: text + text: "State2" + } + } + ] + + Image { + id: image1 + x: 41 + y: 46 + source: "images/qtcreator.png" + } +} diff --git a/tests/manual/qml/testfiles_quick2/subcomponent.qml b/tests/manual/qml/testfiles_quick2/subcomponent.qml new file mode 100644 index 0000000000..5586feb44a --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/subcomponent.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 640 + height: 480 + Component { + id: redSquare + Rectangle { + color: "red" + width: 100 + height: 100 + } + } + + Loader { sourceComponent: redSquare;} + Loader { sourceComponent: redSquare; x: 20 } +} diff --git a/tests/manual/qml/testfiles_quick2/testfiles_quick2.qmlproject b/tests/manual/qml/testfiles_quick2/testfiles_quick2.qmlproject new file mode 100644 index 0000000000..337caca3fe --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/testfiles_quick2.qmlproject @@ -0,0 +1,14 @@ +import QmlProject 1.1 + +Project { + // Scan current directory for .qml, .js, and image files + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } +} diff --git a/tests/manual/qml/testfiles_quick2/usingbutton.qml b/tests/manual/qml/testfiles_quick2/usingbutton.qml new file mode 100644 index 0000000000..76dfbe7f5b --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/usingbutton.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 +import "components" as X + +Rectangle { + width: 640 + height: 480 + + X.MyButton { + } + +} diff --git a/tests/manual/qml/testfiles_quick2/views.qml b/tests/manual/qml/testfiles_quick2/views.qml new file mode 100644 index 0000000000..164b86e75a --- /dev/null +++ b/tests/manual/qml/testfiles_quick2/views.qml @@ -0,0 +1,198 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 640 + height: 480 + + GridView { + id: grid_view1 + x: 35 + y: 28 + width: 140 + height: 140 + cellHeight: 70 + delegate: Item { + x: 5 + height: 50 + Column { + Rectangle { + width: 40 + height: 40 + color: colorCode + anchors.horizontalCenter: parent.horizontalCenter + } + + Text { + x: 5 + text: name + anchors.horizontalCenter: parent.horizontalCenter + font.bold: true + } + spacing: 5 + } + } + model: ListModel { + ListElement { + name: "Grey" + colorCode: "grey" + } + + ListElement { + name: "Red" + colorCode: "red" + } + + ListElement { + name: "Blue" + colorCode: "blue" + } + + ListElement { + name: "Green" + colorCode: "green" + } + } + cellWidth: 70 + } + + ListView { + id: list_view1 + x: 248 + y: 28 + width: 110 + height: 160 + delegate: Item { + x: 5 + height: 40 + Row { + id: row1 + Rectangle { + width: 40 + height: 40 + color: colorCode + } + + Text { + text: name + anchors.verticalCenter: parent.verticalCenter + font.bold: true + } + spacing: 10 + } + } + model: ListModel { + ListElement { + name: "Grey" + colorCode: "grey" + } + + ListElement { + name: "Red" + colorCode: "red" + } + + ListElement { + name: "Blue" + colorCode: "blue" + } + + ListElement { + name: "Green" + colorCode: "green" + } + } + } + + PathView { + id: path_view1 + x: 35 + y: 239 + width: 250 + height: 130 + delegate: Component { + Column { + Rectangle { + width: 40 + height: 40 + color: colorCode + anchors.horizontalCenter: parent.horizontalCenter + } + + Text { + x: 5 + text: name + anchors.horizontalCenter: parent.horizontalCenter + font.bold: true + } + spacing: 5 + } + } + model: ListModel { + ListElement { + name: "Grey" + colorCode: "grey" + } + + ListElement { + name: "Red" + colorCode: "red" + } + + ListElement { + name: "Blue" + colorCode: "blue" + } + + ListElement { + name: "Green" + colorCode: "green" + } + } + path: Path { + PathQuad { + x: 120 + y: 25 + controlY: 75 + controlX: 260 + } + + PathQuad { + x: 120 + y: 100 + controlY: 75 + controlX: -20 + } + startY: 100 + startX: 120 + } + } +} -- cgit v1.2.1