aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/window/tst_clickwindow.qml
blob: d2ab05233233a2df22e5367feb7b0d5c4492a2ee (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.0
import QtQuick.Window 2.0
import QtTest 1.1

Item {
    width: height
    height: 40
    MouseArea {
        id: ma
        anchors.fill: parent

        property bool everClicked: false

        onClicked: everClicked = true;
    }

    Window {
        id: ma2Window
        width: height
        height: 40
        MouseArea {
            id: ma2
            anchors.fill: parent

            property bool everClicked: false

            onClicked: everClicked = true;
        }

        Component.onCompleted: ma2Window.show();
    }

    TestCase {
        name: "ClickWindow"
        when: windowShown

        function test_clickBothWindows() {
            if (Qt.platform.os === "linux" || Qt.platform.os === "windows")
                skip("more details in QTBUG-53785")
            mouseClick(ma, 20, 20);
            verify(ma.everClicked);
            mouseClick(ma2, 20, 20);
            verify(ma2.everClicked);
        }
    }
}