aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickmousearea/data/mask.qml
blob: 1e8ae7c98a31024b7ed153b792891fa8207b4316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2017 Ford Motor Company
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

import QtQuick 2.11
import Test 1.0

Item {
    id: root
    property int clicked: 0
    property int pressed: 0
    property int released: 0

    width: 200; height: 200

    MouseArea {
        id: mouseArea
        width: 200; height: 200
        onPressed: { root.pressed++ }
        onClicked: { root.clicked++ }
        onReleased: { root.released++ }

        containmentMask: CircleMask {
            radius: mouseArea.width/2
        }
    }
}