aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-01-23 12:36:29 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-01-23 12:36:29 +0100
commit03fe99ba3a7d29b1606660baa407cff21c4d4d35 (patch)
tree525d5f03e8703bf7e9a7851280de67a597dceea1 /tests/manual
parentf02e234fc012f4430378bc5205f32914822e4dff (diff)
parent94e6106d357ca5a1349a2b10a69dd84db34065c8 (diff)
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/text/SignalIndicator.qml66
-rw-r--r--tests/manual/text/main.cpp51
-rw-r--r--tests/manual/text/main.qml56
-rw-r--r--tests/manual/text/qml.qrc7
-rw-r--r--tests/manual/text/text.pro7
-rw-r--r--tests/manual/text/textInputPropertiesAndSignals.qml134
-rw-r--r--tests/manual/touch/mpta-crosshairs.qml85
-rw-r--r--tests/manual/v4/tests.pro2
8 files changed, 386 insertions, 22 deletions
diff --git a/tests/manual/text/SignalIndicator.qml b/tests/manual/text/SignalIndicator.qml
new file mode 100644
index 0000000000..3eaadde6d7
--- /dev/null
+++ b/tests/manual/text/SignalIndicator.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the manual tests 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 The Qt Company Ltd 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.9
+
+Rectangle {
+ implicitWidth: text.implicitWidth * 1.2
+ implicitHeight: text.implicitHeight * 1.1
+ color: "lightgrey"
+ property color blipColor: "green"
+ property int blipDuration: 30 // ms
+ property alias label: text.text
+
+ function blip() {
+ blipAnim.start()
+ }
+
+ SequentialAnimation on color {
+ id: blipAnim
+ PropertyAction { value: blipColor }
+ PauseAnimation { duration: blipDuration }
+ PropertyAction { value: "lightgrey" }
+ }
+
+ Text {
+ id: text
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/manual/text/main.cpp b/tests/manual/text/main.cpp
new file mode 100644
index 0000000000..a4e1060cf5
--- /dev/null
+++ b/tests/manual/text/main.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the manual tests 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 The Qt Company Ltd 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 <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+ return app.exec();
+}
diff --git a/tests/manual/text/main.qml b/tests/manual/text/main.qml
new file mode 100644
index 0000000000..d7e214ee38
--- /dev/null
+++ b/tests/manual/text/main.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the manual tests 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 The Qt Company Ltd 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.9
+import QtQuick.Window 2.2
+import "qrc:/quick/shared/" as Examples
+
+Window {
+ width: 800
+ height: 600
+ visible: true
+ Examples.LauncherList {
+ id: ll
+ anchors.fill: parent
+ Component.onCompleted: {
+ addExample("TextInput", "TextInput properties and signals", Qt.resolvedUrl("textInputPropertiesAndSignals.qml"))
+ }
+ }
+}
diff --git a/tests/manual/text/qml.qrc b/tests/manual/text/qml.qrc
new file mode 100644
index 0000000000..555e37bd69
--- /dev/null
+++ b/tests/manual/text/qml.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ <file>textInputPropertiesAndSignals.qml</file>
+ <file>SignalIndicator.qml</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/text/text.pro b/tests/manual/text/text.pro
new file mode 100644
index 0000000000..3705d41df0
--- /dev/null
+++ b/tests/manual/text/text.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+
+QT += qml quick
+
+SOURCES += main.cpp
+
+RESOURCES += qml.qrc ../../../examples/quick/shared/quick_shared.qrc
diff --git a/tests/manual/text/textInputPropertiesAndSignals.qml b/tests/manual/text/textInputPropertiesAndSignals.qml
new file mode 100644
index 0000000000..a3fd602c16
--- /dev/null
+++ b/tests/manual/text/textInputPropertiesAndSignals.qml
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the manual tests 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 The Qt Company Ltd 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.9
+import QtQuick.Layouts 1.1
+import "qrc:/quick/shared/" as Shared
+
+Item {
+ width: 600; height: 600
+ GridLayout {
+ columns: 3; rowSpacing: 6; columnSpacing: 6
+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: 12 }
+
+ // ----------------------------------------------------
+ Text {
+ text: "try typing and input methods in the TextInput below:"
+ Layout.columnSpan: 3
+ }
+
+ // ----------------------------------------------------
+ Text {
+ text: "TextInput"
+ }
+
+ Rectangle {
+ Layout.fillWidth: true
+ implicitHeight: textInput.implicitHeight + 8
+ radius: 4; antialiasing: true
+ border.color: "black"; color: "transparent"
+
+ TextInput {
+ id: textInput
+ anchors.fill: parent; anchors.margins: 4
+
+ onTextEdited: textEditedInd.blip()
+ onTextChanged: textChangedInd.blip()
+ onPreeditTextChanged: preeditInd.blip()
+ onDisplayTextChanged: displayTextInd.blip()
+ }
+
+ }
+
+ SignalIndicator {
+ id: textEditedInd
+ label: "textEdited"
+ }
+
+ // ----------------------------------------------------
+ Text { text: "text" }
+
+ Text { text: textInput.text; Layout.fillWidth: true }
+
+ SignalIndicator {
+ id: textChangedInd
+ label: "textChanged"
+ }
+
+ // ----------------------------------------------------
+ Text { text: "preeditText" }
+
+ Text { text: textInput.preeditText; Layout.fillWidth: true }
+
+ SignalIndicator {
+ id: preeditInd
+ label: "preeditTextChanged"
+ }
+
+ // ----------------------------------------------------
+ Text { text: "displayText" }
+
+ Text { text: textInput.displayText; Layout.fillWidth: true }
+
+ SignalIndicator {
+ id: displayTextInd
+ label: "displayTextChanged"
+ }
+
+ // ----------------------------------------------------
+ Shared.TextField {
+ id: copyFrom
+ Layout.column: 1
+ Layout.row: 5
+ Layout.fillWidth: true
+ text: "copy this"
+ }
+
+ Shared.Button {
+ Layout.column: 2
+ Layout.row: 5
+ text: "setText"
+ onClicked: {
+ Qt.inputMethod.reset()
+ textInput.text = copyFrom.text
+ }
+ }
+ }
+}
diff --git a/tests/manual/touch/mpta-crosshairs.qml b/tests/manual/touch/mpta-crosshairs.qml
index 8b71e4fdc3..d1dbd0f188 100644
--- a/tests/manual/touch/mpta-crosshairs.qml
+++ b/tests/manual/touch/mpta-crosshairs.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the manual tests of the Qt Toolkit.
@@ -38,11 +38,13 @@
**
****************************************************************************/
-import QtQuick 2.4
+import QtQuick 2.9
import QtQuick.Window 2.2
Rectangle {
id: root
+ width: 480
+ height: 480
color: "black"
MultiPointTouchArea {
@@ -51,11 +53,11 @@ Rectangle {
touchPoints: [
TouchPoint { property color color: "red" },
TouchPoint { property color color: "orange" },
- TouchPoint { property color color: "yellow" },
+ TouchPoint { property color color: "lightsteelblue" },
TouchPoint { property color color: "green" },
TouchPoint { property color color: "blue" },
TouchPoint { property color color: "violet" },
- TouchPoint { property color color: "cyan" },
+ TouchPoint { property color color: "steelblue" },
TouchPoint { property color color: "magenta" },
TouchPoint { property color color: "goldenrod" },
TouchPoint { property color color: "darkgray" }
@@ -65,40 +67,81 @@ Rectangle {
model: 10
Item {
- anchors.fill: parent
+ id: crosshairs
property TouchPoint touchPoint
+ x: touchPoint.x - width / 2
+ y: touchPoint.y - height / 2
+ width: 300; height: 300
visible: touchPoint.pressed
+ rotation: touchPoint.rotation
Rectangle {
color: touchPoint.color
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- width: 2
- x: touchPoint.x - 1
+ anchors.centerIn: parent
+ width: 2; height: parent.height
+ antialiasing: true
}
Rectangle {
color: touchPoint.color
- anchors.left: parent.left
- anchors.right: parent.right
- height: 2
- y: touchPoint.y - 1
+ anchors.centerIn: parent
+ width: parent.width; height: 2
+ antialiasing: true
}
Rectangle {
color: touchPoint.color
- width: 50 * touchPoint.pressure
- height: width
+ implicitWidth: label.implicitWidth + 8
+ implicitHeight: label.implicitHeight + 16
radius: width / 2
- x: touchPoint.x - width / 2
- y: touchPoint.y - width / 2
+ anchors.centerIn: parent
+ antialiasing: true
+ Rectangle {
+ color: "black"
+ opacity: 0.35
+ width: (parent.width - 8) * touchPoint.pressure
+ height: width
+ radius: width / 2
+ anchors.centerIn: parent
+ antialiasing: true
+ }
+ Rectangle {
+ color: "transparent"
+ border.color: "white"
+ border.width: 2
+ opacity: 0.75
+ visible: width > 0
+ width: touchPoint.ellipseDiameters.width
+ height: touchPoint.ellipseDiameters.height
+ radius: Math.min(width, height) / 2
+ anchors.centerIn: parent
+ antialiasing: true
+ }
+ Text {
+ id: label
+ anchors.centerIn: parent
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ property string uid: touchPoint.uniqueId === undefined || touchPoint.uniqueId.numericId === -1 ?
+ "" : "\nUID " + touchPoint.uniqueId.numericId
+ text: "x " + touchPoint.x.toFixed(1) +
+ "\ny " + touchPoint.y.toFixed(1) + uid +
+ "\nID " + touchPoint.pointId.toString(16) +
+ "\n∡" + touchPoint.rotation.toFixed(1) + "°"
+ }
}
Rectangle {
id: velocityVector
visible: width > 0
width: touchPoint.velocity.length()
- height: 1
- x: touchPoint.x
- y: touchPoint.y
- rotation: width > 0 ? Math.acos(touchPoint.velocity.x / width) : 0
+ height: 4
+ Behavior on width { SmoothedAnimation { duration: 200 } }
+ radius: height / 2
+ antialiasing: true
+ color: "gray"
+ x: crosshairs.width / 2
+ y: crosshairs.height / 2
+ rotation: width > 0 ? Math.atan2(touchPoint.velocity.y, touchPoint.velocity.x) * 180 / Math.PI - crosshairs.rotation : 0
+ Behavior on rotation { SmoothedAnimation { duration: 20 } }
transformOrigin: Item.BottomLeft
}
diff --git a/tests/manual/v4/tests.pro b/tests/manual/v4/tests.pro
index a86a6bf6af..ce4a34f7a0 100644
--- a/tests/manual/v4/tests.pro
+++ b/tests/manual/v4/tests.pro
@@ -1,7 +1,7 @@
TEMPLATE = aux
TESTSCRIPT=$$PWD/test262.py
-V4CMD = qmljs
+isEmpty(V4CMD): V4CMD = qmljs
checktarget.target = check
checktarget.commands = python $$TESTSCRIPT --command=$$V4CMD --parallel --with-test-expectations --update-expectations