aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-10-28 09:31:56 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-10-28 15:26:38 +0100
commite2cf338a1df9c37e50b31d99df48bd3adc866c52 (patch)
tree3e65f28993fbfdbac323d3d64835110c0ec57d6a
parent27bd9cab73a1e7e3d66e6025ace8510f932c5df8 (diff)
Make touchmouse pinch test qml manually testable and visually sensible
- There was no reason to import Qt.test - Make colors less garish - Explain what the rectangle is for (it's not the only place for pinching, and the appearance is a bit misleading) - Show click feedback at the position instead of toggling colors Change-Id: Id75a52e46a5e8611a57eb69a037cced9a9f7d54f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--tests/auto/quick/touchmouse/data/mouseonflickableonpinch.qml27
-rw-r--r--tests/auto/quick/touchmouse/data/pinchonflickable.qml8
2 files changed, 21 insertions, 14 deletions
diff --git a/tests/auto/quick/touchmouse/data/mouseonflickableonpinch.qml b/tests/auto/quick/touchmouse/data/mouseonflickableonpinch.qml
index 015391f291..0cb67cf62c 100644
--- a/tests/auto/quick/touchmouse/data/mouseonflickableonpinch.qml
+++ b/tests/auto/quick/touchmouse/data/mouseonflickableonpinch.qml
@@ -1,11 +1,9 @@
import QtQuick 2.0
-import Qt.test 1.0
Rectangle {
id: root
width: 600
height: 600
- color: "green"
PinchArea {
objectName: "pincharea"
@@ -23,25 +21,34 @@ Rectangle {
MouseArea {
anchors.fill: parent
- onClicked: {
- if (rect.color == "#000000")
- rect.color = "#00ff00"
- else
- rect.color = "#000000"
+ property int nextTimestamp: 0
+ Component {
+ id: clickFeeback
+ Text {
+ text: parent.timestamp
+ Rectangle {
+ color: "red"
+ width: 5; height: 5; radius: 2
+ x: -2; y: -2
+ }
+ }
}
+
+ onClicked: clickFeeback.createObject(parent, { x: mouse.x - 2, y: mouse.y - 2, text: nextTimestamp++ })
}
Rectangle {
objectName: "rect"
id: rect
- color: "blue"
+ color: "lightsteelblue"
x: 200
y: 200
width: 400
height: 400
+ Text {
+ text: "pinch, click or flick anywhere\nthis rectangle is the pinch target"
+ }
}
}
}
-
}
-
diff --git a/tests/auto/quick/touchmouse/data/pinchonflickable.qml b/tests/auto/quick/touchmouse/data/pinchonflickable.qml
index 2a7a91006e..14a41c522a 100644
--- a/tests/auto/quick/touchmouse/data/pinchonflickable.qml
+++ b/tests/auto/quick/touchmouse/data/pinchonflickable.qml
@@ -1,11 +1,9 @@
import QtQuick 2.0
-//import Qt.test 1.0
Rectangle {
id: root
width: 600
height: 600
- color: "green"
Flickable {
objectName: "flickable"
@@ -16,11 +14,14 @@ Rectangle {
Rectangle {
objectName: "rect"
id: rect
- color: "blue"
+ color: "steelblue"
x: 200
y: 200
width: 400
height: 400
+ Text {
+ text: "pinch or flick anywhere\nthis rectangle is the pinch target"
+ }
}
PinchArea {
objectName: "pincharea"
@@ -32,4 +33,3 @@ Rectangle {
}
}
}
-