diff options
Diffstat (limited to 'src/quick/doc/snippets/qml/focus')
5 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml b/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml index a5a4eae0ab..43d5defad4 100644 --- a/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml +++ b/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml @@ -65,7 +65,7 @@ FocusScope { color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true Text { id: label; anchors.centerIn: parent } focus: true - Keys.onPressed: { + Keys.onPressed: (event)=> { if (event.key == Qt.Key_A) label.text = 'Key A was pressed' else if (event.key == Qt.Key_B) diff --git a/src/quick/doc/snippets/qml/focus/MyWidget.qml b/src/quick/doc/snippets/qml/focus/MyWidget.qml index 82d7ee35b4..d446489813 100644 --- a/src/quick/doc/snippets/qml/focus/MyWidget.qml +++ b/src/quick/doc/snippets/qml/focus/MyWidget.qml @@ -56,7 +56,7 @@ Rectangle { color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true Text { id: label; anchors.centerIn: parent} focus: true - Keys.onPressed: { + Keys.onPressed: (event)=> { if (event.key == Qt.Key_A) label.text = 'Key A was pressed' else if (event.key == Qt.Key_B) diff --git a/src/quick/doc/snippets/qml/focus/basicwidget.qml b/src/quick/doc/snippets/qml/focus/basicwidget.qml index ddcf95b69a..3fd9fab748 100644 --- a/src/quick/doc/snippets/qml/focus/basicwidget.qml +++ b/src/quick/doc/snippets/qml/focus/basicwidget.qml @@ -56,7 +56,7 @@ Rectangle { Item { id: keyHandler focus: true - Keys.onPressed: { + Keys.onPressed: (event)=> { if (event.key == Qt.Key_A) myText.text = 'Key A was pressed' else if (event.key == Qt.Key_B) diff --git a/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml b/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml index 3283bcfcbf..6dd892f37d 100644 --- a/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml +++ b/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml @@ -64,7 +64,7 @@ FocusScope { color: "lightsteelblue"; width: 175; height: 25; radius: 10; antialiasing: true Text { id: label; anchors.centerIn: parent } focus: true - Keys.onPressed: { + Keys.onPressed: (event)=> { if (event.key == Qt.Key_A) label.text = 'Key A was pressed' else if (event.key == Qt.Key_B) diff --git a/src/quick/doc/snippets/qml/focus/rectangle.qml b/src/quick/doc/snippets/qml/focus/rectangle.qml index 5675ae44b2..d49bf1d0d6 100644 --- a/src/quick/doc/snippets/qml/focus/rectangle.qml +++ b/src/quick/doc/snippets/qml/focus/rectangle.qml @@ -53,7 +53,7 @@ import QtQuick 2.0 Rectangle { width: 100; height: 100 focus: true - Keys.onPressed: { + Keys.onPressed: (event)=> { if (event.key == Qt.Key_A) { console.log('Key A was pressed'); event.accepted = true; |