diff --git a/Motus/main.qml b/Motus/main.qml index fc5f0de19102bbb9b25a9265360a9f01431556d1..c48ecf5483fafcaf2fc1d0349a474f27f39345b4 100644 --- a/Motus/main.qml +++ b/Motus/main.qml @@ -13,18 +13,31 @@ Window { width: 300 height: 100 color: "#b93838" + focus: true + + + Case { - id: _case + id: case1 x: 8 y: 20 + _textText: "A" } Case { - id: _case1 + id: case2 x: 197 y: 20 _textText: "B" } + + Keys.onPressed: (event)=> { + if (event.key === Qt.Key_A) { + case1._textText = qsTr("C"); // Correcte modification + console.log(event.key + " /// " + event.text); + event.accepted = true; + } + } } }