diff options
author | Evgeniy A. Dushistov <dushistov@mail.ru> | 2020-08-18 22:22:10 +0300 |
---|---|---|
committer | Evgeniy A. Dushistov <dushistov@mail.ru> | 2020-08-19 10:09:30 +0300 |
commit | 69be96b97833cf45c72e8a29834b521e4523c507 (patch) | |
tree | 0152d96248ac3c304b4da2a2a57a1d3c8c0c05ef /tests/auto/qml/qmllint | |
parent | 9bb8686f158fd5671dc6eb96aaefde7485d0f485 (diff) |
qmllint: handle signals defined in qml file
FindWarningVisitor for signal add property "signal" + "Changed",
so it was impossible find "singal" and "onSingal" names.
Fixes: QTBUG-83793
Change-Id: I5a62211f413f543fdb6bf00e0ab921561d7a9643
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmllint')
-rw-r--r-- | tests/auto/qml/qmllint/data/Signal.qml | 13 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/Signal.qml b/tests/auto/qml/qmllint/data/Signal.qml new file mode 100644 index 0000000000..c462b90bc2 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Signal.qml @@ -0,0 +1,13 @@ +import QtQuick 2.15 + +Rectangle { + id: messenger + + signal send( string person, string notice) + + onSend: function(person, notice) { + console.log("For " + person + ", the notice is: " + notice) + } + + Component.onCompleted: messenger.send("Tom", "the door is ajar.") +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 7466043389..705ff7686f 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -230,6 +230,7 @@ void TestQmllint::cleanQmlCode_data() QTest::newRow("AttachedType") << QStringLiteral("AttachedType.qml"); QTest::newRow("qmldirImportAndDepend") << QStringLiteral("qmldirImportAndDepend/good.qml"); QTest::newRow("ParentEnum") << QStringLiteral("parentEnum.qml"); + QTest::newRow("Signals") << QStringLiteral("Signal.qml"); } void TestQmllint::cleanQmlCode() |