aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/pointer
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-04-26 16:06:45 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-06-29 14:42:11 +0000
commitda722fb448f06cf43780e6f857a1ccd9f07176d6 (patch)
tree3bea83e40d751c361f76bb1f76fc1d591330d34e /tests/manual/pointer
parentdd333172e2ade1db6d0af72b4ed44262c2b4d8c7 (diff)
Replace MultiPtHndlr.pointDistanceThreshold with PointerHandler.margin
It's not just useful for PinchHandler: TapHandler has a good use for it too. But unfortunately if the handler's parent Item has a custom mask, we don't have a way to augment the mask with a margin; so if margin is set, we assume the bounds are rectangular. QQuickMultiPointHandler::eligiblePoints() now calls wantsEventPoint() rather than bounds-checking the point directly: this adds flexibility, potentially allowing an override in subclasses, if we need it later. Task-number: QTBUG-68077 Change-Id: I65c95f00c532044a5862654e58c9c5f8c973df81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/manual/pointer')
-rw-r--r--tests/manual/pointer/content/MultiButton.qml1
-rw-r--r--tests/manual/pointer/multibuttons.qml3
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/manual/pointer/content/MultiButton.qml b/tests/manual/pointer/content/MultiButton.qml
index 2a41967a36..ca9b16a957 100644
--- a/tests/manual/pointer/content/MultiButton.qml
+++ b/tests/manual/pointer/content/MultiButton.qml
@@ -35,6 +35,7 @@ Rectangle {
property alias pressed: tap.pressed
property bool checked: false
property alias gesturePolicy: tap.gesturePolicy
+ property alias margin: tap.margin
signal tapped
width: label.implicitWidth * 1.5; height: label.implicitHeight * 2.0
diff --git a/tests/manual/pointer/multibuttons.qml b/tests/manual/pointer/multibuttons.qml
index cd7c5d0b19..28c3cc0f50 100644
--- a/tests/manual/pointer/multibuttons.qml
+++ b/tests/manual/pointer/multibuttons.qml
@@ -44,6 +44,7 @@ Item {
label: "Launch Balloons"
Layout.fillWidth: true
gesturePolicy: TapHandler.WithinBounds
+ margin: 10
}
Text { text: "the goons"; font.pointSize: 12 }
MultiButton {
@@ -51,6 +52,7 @@ Item {
label: "Launch Missile"
Layout.fillWidth: true
gesturePolicy: TapHandler.ReleaseWithinBounds
+ margin: 10
onTapped: missileEmitter.burst(1)
}
MultiButton {
@@ -58,6 +60,7 @@ Item {
label: "Launch Fighters"
Layout.fillWidth: true
gesturePolicy: TapHandler.DragThreshold
+ margin: 10
}
}
ParticleSystem {