diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-01-15 16:29:01 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-01-26 08:49:40 +0000 |
commit | b2b221945d80daa58027cef9ddd28ea750e30e1e (patch) | |
tree | 00cbd52bb3124112ad1d02cf1fd3491b8f5ff064 /examples/quick/shapes | |
parent | f9dc375fbd329e80bda8ceb6e3a425917bb1f4fd (diff) |
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 <paolo.angelelli@qt.io>
Diffstat (limited to 'examples/quick/shapes')
-rw-r--r-- | examples/quick/shapes/content/tapableTriangle.qml | 5 |
1 files changed, 3 insertions, 2 deletions
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" |