aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/signalsAndHandlers.qml
blob: 47280bca461f25a30198e3a44127263091886c53 (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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick

Item {
    id: rootId
    signal helloSignal()

    function callSignals() {
        helloSignal()
        if (false) {
            helloSignal()
        } else {
        // helloSignal() // not a usage btw
            if (true)
                helloSignal()
        }
    }
    function callSignals2() {
        helloSignal()
        if (false) {
            widthChanged()
        } else {
        // helloSignal() // not a usage btw
            if (true)
                widthChanged()
            rootId.widthChanged()
        }
    }
    Item {
        function callSignalsInChild() {
            widthChanged()
            rootId.widthChanged()
        }
    }

    function myHelloHandler() { let x = 32; }
    onHelloSignal: myHelloHandler
}