diff options
Diffstat (limited to 'tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers')
3 files changed, 89 insertions, 0 deletions
diff --git a/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/signalAndHandlers2.qml b/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/signalAndHandlers2.qml new file mode 100644 index 0000000000..d10768dd42 --- /dev/null +++ b/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/signalAndHandlers2.qml @@ -0,0 +1,43 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick + +Item { + function myHelloHandler() { let x = 32; } + onHelloSignal: myHelloHandler + + property int helloPropertyBinding + helloPropertyBinding: 123 + + property int checkHandlers + onCheckHandlersChanged: myHelloHandler + onChildrenChanged: myHelloHandler + function callChanged() { + checkHandlersChanged() + childrenChanged() + } + property int _: 48 + property int ______42: 48 + property int _123a: 48 + on_Changed: myHelloHandler + on______42Changed: myHelloHandler + on_123AChanged: myHelloHandler + function weirdPropertynames() { + _Changed() + ______42Changed() + _123aChanged() + } + + TapHandler { + onTapped: myHelloHandler + function f() { + tapped() + } + } + + function anotherF() { + helloPropertyChanged() + } + onHelloPropertyChanged: myHelloHandler +} diff --git a/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/signalsAndHandlers.qml b/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/signalsAndHandlers.qml new file mode 100644 index 0000000000..47280bca46 --- /dev/null +++ b/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/signalsAndHandlers.qml @@ -0,0 +1,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 +} diff --git a/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/widthChangedInAnotherFile.qml b/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/widthChangedInAnotherFile.qml new file mode 100644 index 0000000000..aecee2437a --- /dev/null +++ b/tests/auto/qmlls/utils/data/findUsages/signalsAndHandlers/widthChangedInAnotherFile.qml @@ -0,0 +1,6 @@ +import QtQuick + +Item { + function f() {} + onWidthChanged: f +} |