From b2b221945d80daa58027cef9ddd28ea750e30e1e Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 15 Jan 2018 16:29:01 +0100 Subject: demonstrate containsMask in the tapableTriangle Shape example This isn't an improvement in behvior, it just shows that a Shape can be used as a mask on some other Item. But Shape.containsMode is still important so that when the outer Rectangle's contains() calls Shape.contains(), the latter will do the right thing. Change-Id: I1bd127784e708f30561945a4958e4d5f0c1c0b85 Reviewed-by: Paolo Angelelli --- examples/quick/shapes/content/tapableTriangle.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/quick/shapes/content/tapableTriangle.qml b/examples/quick/shapes/content/tapableTriangle.qml index ba1fa1e460..274552f525 100644 --- a/examples/quick/shapes/content/tapableTriangle.qml +++ b/examples/quick/shapes/content/tapableTriangle.qml @@ -56,14 +56,15 @@ Rectangle { width: 120 height: 120 color: th.pressed ? "steelBlue" : "lightGray" + containsMask: ctr + + TapHandler { id: th } Shape { id: ctr anchors.fill: parent containsMode: Shape.FillContains - TapHandler { id: th } - ShapePath { strokeColor: "red" fillColor: "blue" -- cgit v1.2.3