diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-12-27 15:08:04 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-04-27 05:41:21 +0000 |
commit | 5d45aa1a6400b9fdb9bafa0559675996aff5e58a (patch) | |
tree | c5e28c73152b6c5e8b931814668910671968bb38 /tests/manual/pointer/fakeFlickable.qml | |
parent | f1b4348dae2b992aeaa75e4257c6db4a5182415c (diff) |
Add WheelHandler
It can be used to change any qreal property of its target Item in
response to wheel rotation, or it can be used in other ways that involve
bindings but without a target item.
[ChangeLog][QtQuick][Event Handlers] Added WheelHandler, which handles
mouse wheel rotation by modifying arbitrary Item properties.
Fixes: QTBUG-68119
Change-Id: I247e2325ee993cc1b91a47fbd6c4ba0ffde7ad49
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/manual/pointer/fakeFlickable.qml')
-rw-r--r-- | tests/manual/pointer/fakeFlickable.qml | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/manual/pointer/fakeFlickable.qml b/tests/manual/pointer/fakeFlickable.qml index 3007848c9f..be52e4dbaa 100644 --- a/tests/manual/pointer/fakeFlickable.qml +++ b/tests/manual/pointer/fakeFlickable.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the manual tests of the Qt Toolkit. @@ -30,6 +30,7 @@ import QtQuick 2.12 import "content" Rectangle { + id: root color: "#444" width: 480 height: 640 @@ -49,8 +50,14 @@ Rectangle { ", parent " + parent + " geom " + parent.width + "x" + parent.height) } - onFlickStarted: console.log("flick started with velocity " + velocity) - onFlickEnded: console.log("flick ended with velocity " + velocity) + onFlickStarted: { + root.border.color = "green" + console.log("flick started with velocity " + velocity) + } + onFlickEnded: { + root.border.color = "transparent" + console.log("flick ended with velocity " + velocity) + } Component.onCompleted: { var request = new XMLHttpRequest() |