aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/mousearea
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-03-10 15:09:37 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-12 15:03:03 +0100
commit26c5243491f495194f04b449128dae36118e28da (patch)
tree7fb14678a6fc9e44a10c9224d005e2cbdc6bcb63 /examples/quick/mousearea
parent1c7d264e3b2e9a2f0021786ea6967185f8282af0 (diff)
parentc24c5baeda4101b0058689adf9200b77a722c3a2 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
Diffstat (limited to 'examples/quick/mousearea')
-rw-r--r--examples/quick/mousearea/mousearea-wheel-example.qml2
-rw-r--r--examples/quick/mousearea/mousearea.qml6
2 files changed, 5 insertions, 3 deletions
diff --git a/examples/quick/mousearea/mousearea-wheel-example.qml b/examples/quick/mousearea/mousearea-wheel-example.qml
index 44b9216285..5e8fba3ac3 100644
--- a/examples/quick/mousearea/mousearea-wheel-example.qml
+++ b/examples/quick/mousearea/mousearea-wheel-example.qml
@@ -63,6 +63,8 @@ Rectangle {
model: ["#9ACD32", "#EEEEEE", "#FFD700", "#87CEEB"]
Rectangle {
+ required property color modelData
+
property real scaleFactor: 1
height: 40 * scaleFactor
diff --git a/examples/quick/mousearea/mousearea.qml b/examples/quick/mousearea/mousearea.qml
index 1540d85fdd..cecbc2cfc8 100644
--- a/examples/quick/mousearea/mousearea.qml
+++ b/examples/quick/mousearea/mousearea.qml
@@ -76,7 +76,7 @@ Rectangle {
onEntered: info.text = 'Entered'
onExited: info.text = 'Exited (pressed=' + pressed + ')'
- onPressed: {
+ onPressed: (mouse) => {
if (mouse.button == Qt.LeftButton)
buttonID = 'LeftButton'
else if (mouse.button == Qt.RightButton)
@@ -139,14 +139,14 @@ Rectangle {
+ ' (' + posInBox.x + ',' + posInBox.y + ' in window)'
}
- onReleased: {
+ onReleased: (mouse) => {
btn.text = 'Released (isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')'
posInfo.text = ''
}
//! [clicks]
onPressAndHold: btn.text = 'Press and hold'
- onClicked: btn.text = 'Clicked (wasHeld=' + mouse.wasHeld + ')'
+ onClicked: (mouse) => { btn.text = 'Clicked (wasHeld=' + mouse.wasHeld + ')' }
onDoubleClicked: btn.text = 'Double clicked'
//! [clicks]
}