diff options
Diffstat (limited to 'src/quick/doc/snippets/qml/item/containmentMask-shape.qml')
-rw-r--r-- | src/quick/doc/snippets/qml/item/containmentMask-shape.qml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/quick/doc/snippets/qml/item/containmentMask-shape.qml b/src/quick/doc/snippets/qml/item/containmentMask-shape.qml new file mode 100644 index 0000000000..171437c380 --- /dev/null +++ b/src/quick/doc/snippets/qml/item/containmentMask-shape.qml @@ -0,0 +1,33 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Shapes + +//![0] +Rectangle { + width: 90; height: 100 + color: hoverHandler.hovered ? "wheat" : "lightgray" + containmentMask: shape + + HoverHandler { id: hoverHandler } + + Shape { + id: shape + containsMode: Shape.FillContains + + ShapePath { + fillColor: "lightsteelblue" + startX: 10; startY: 20 + PathArc { + x: 10; y: 80 + radiusX: 40; radiusY: 40 + useLargeArc: true + } + PathLine { + x: 10; y: 20 + } + } + } +} +//![0] |