aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/doc')
-rw-r--r--src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml6
-rw-r--r--src/quick/doc/snippets/pointerHandlers/wheelHandler.qml5
-rw-r--r--src/quick/doc/snippets/qml/focus/MyClickableWidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/MyWidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/basicwidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/rectangle.qml2
-rw-r--r--src/quick/doc/snippets/qml/keys/keys-pressed.qml2
-rw-r--r--src/quick/doc/snippets/qml/loader/KeyReader.qml2
-rw-r--r--src/quick/doc/snippets/qml/loader/connections.qml2
-rw-r--r--src/quick/doc/snippets/qml/loader/focus.qml2
-rw-r--r--src/quick/doc/snippets/qml/mousearea/mousearea.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml2
-rw-r--r--src/quick/doc/snippets/qml/springanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/text/onLinkActivated.qml2
16 files changed, 20 insertions, 19 deletions
diff --git a/src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml b/src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml
index f556c238da..deff59d034 100644
--- a/src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml
+++ b/src/quick/doc/snippets/pointerHandlers/tapHandlerOnTapped.qml
@@ -56,9 +56,9 @@ Rectangle {
TapHandler {
acceptedButtons: Qt.LeftButton | Qt.RightButton
- onTapped: console.log("tapped", eventPoint.event.device.name,
- "button", eventPoint.event.button,
- "@", eventPoint.scenePosition)
+ onTapped: (eventPoint)=> console.log("tapped", eventPoint.event.device.name,
+ "button", eventPoint.event.button,
+ "@", eventPoint.scenePosition)
}
}
//![0]
diff --git a/src/quick/doc/snippets/pointerHandlers/wheelHandler.qml b/src/quick/doc/snippets/pointerHandlers/wheelHandler.qml
index 2c9913ac97..b3d659b4e5 100644
--- a/src/quick/doc/snippets/pointerHandlers/wheelHandler.qml
+++ b/src/quick/doc/snippets/pointerHandlers/wheelHandler.qml
@@ -56,8 +56,9 @@ Rectangle {
WheelHandler {
property: "rotation"
- onWheel: console.log("rotation", event.angleDelta.y,
- "scaled", rotation, "@", point.position, "=>", parent.rotation)
+ onWheel: (event)=> console.log("rotation", event.angleDelta.y,
+ "scaled", rotation, "@", point.position,
+ "=>", parent.rotation)
}
}
//![0]
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;
diff --git a/src/quick/doc/snippets/qml/keys/keys-pressed.qml b/src/quick/doc/snippets/qml/keys/keys-pressed.qml
index 418691dc9a..592d83b525 100644
--- a/src/quick/doc/snippets/qml/keys/keys-pressed.qml
+++ b/src/quick/doc/snippets/qml/keys/keys-pressed.qml
@@ -57,7 +57,7 @@ Item {
Item {
anchors.fill: parent
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Left) {
console.log("move left");
event.accepted = true;
diff --git a/src/quick/doc/snippets/qml/loader/KeyReader.qml b/src/quick/doc/snippets/qml/loader/KeyReader.qml
index 56604319e0..c68ebf4f1a 100644
--- a/src/quick/doc/snippets/qml/loader/KeyReader.qml
+++ b/src/quick/doc/snippets/qml/loader/KeyReader.qml
@@ -42,7 +42,7 @@ import QtQuick 2.0
Item {
Item {
focus: true
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
console.log("KeyReader captured:",
event.text);
event.accepted = true;
diff --git a/src/quick/doc/snippets/qml/loader/connections.qml b/src/quick/doc/snippets/qml/loader/connections.qml
index 5ff57a1d38..5b2126a8fd 100644
--- a/src/quick/doc/snippets/qml/loader/connections.qml
+++ b/src/quick/doc/snippets/qml/loader/connections.qml
@@ -49,7 +49,7 @@ Item {
Connections {
target: myLoader.item
- onMessage: console.log(msg)
+ function onMessage(msg) { console.log(msg) }
}
}
//![0]
diff --git a/src/quick/doc/snippets/qml/loader/focus.qml b/src/quick/doc/snippets/qml/loader/focus.qml
index f3509021f1..b59f72c729 100644
--- a/src/quick/doc/snippets/qml/loader/focus.qml
+++ b/src/quick/doc/snippets/qml/loader/focus.qml
@@ -54,7 +54,7 @@ Rectangle {
}
}
- Keys.onPressed: {
+ Keys.onPressed: (event)=> {
console.log("Captured:",
event.text);
}
diff --git a/src/quick/doc/snippets/qml/mousearea/mousearea.qml b/src/quick/doc/snippets/qml/mousearea/mousearea.qml
index fd47752bb7..d3f307c0f2 100644
--- a/src/quick/doc/snippets/qml/mousearea/mousearea.qml
+++ b/src/quick/doc/snippets/qml/mousearea/mousearea.qml
@@ -77,7 +77,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
- onClicked: {
+ onClicked: (mouse)=> {
if (mouse.button == Qt.RightButton)
parent.color = 'blue';
else
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
index 96f7fc1c7c..709582986d 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
@@ -59,7 +59,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
- onClicked: rect.buttonClicked(mouse.x, mouse.y)
+ onClicked: (mouse)=> rect.buttonClicked(mouse.x, mouse.y)
}
}
//![0]
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
index 8c9c5a09ab..2de2e9bbc7 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
@@ -52,7 +52,7 @@ import QtQuick 2.0
// application.qml
Button {
width: 100; height: 100
- onButtonClicked: {
+ onButtonClicked: (xPos, yPos)=> {
console.log("Mouse clicked at " + xPos + "," + yPos)
}
}
diff --git a/src/quick/doc/snippets/qml/springanimation.qml b/src/quick/doc/snippets/qml/springanimation.qml
index 658bcfb7d7..c18d662abc 100644
--- a/src/quick/doc/snippets/qml/springanimation.qml
+++ b/src/quick/doc/snippets/qml/springanimation.qml
@@ -65,7 +65,7 @@ Item {
MouseArea {
anchors.fill: parent
- onClicked: {
+ onClicked: (mouse)=> {
rect.x = mouse.x - rect.width/2
rect.y = mouse.y - rect.height/2
}
diff --git a/src/quick/doc/snippets/qml/text/onLinkActivated.qml b/src/quick/doc/snippets/qml/text/onLinkActivated.qml
index 07bae61089..b6c876f3d7 100644
--- a/src/quick/doc/snippets/qml/text/onLinkActivated.qml
+++ b/src/quick/doc/snippets/qml/text/onLinkActivated.qml
@@ -56,7 +56,7 @@ Rectangle {
Text {
textFormat: Text.RichText
text: "See the <a href=\"http://qt-project.org\">Qt Project website</a>."
- onLinkActivated: console.log(link + " link activated")
+ onLinkActivated: (link)=> console.log(link + " link activated")
}
//![0]