QML 相當於 QEventPoint . 更多...
| import 語句: |
import QtQuick
|
| 在 C++: | QEventPoint |
eventPoint is the Qml value type representation of QEventPoint 。它擁有相同特性如 QEventPoint .
下列特性可用:
eventPoint.accepted
eventPoint.device
eventPoint.ellipseDiameters
eventPoint.globalGrabPosition
eventPoint.globalLastPosition
eventPoint.globalPosition
eventPoint.globalPressPosition
eventPoint.grabPosition
eventPoint.id
eventPoint.lastPosition
eventPoint.lastTimestamp
eventPoint.position
eventPoint.pressPosition
eventPoint.pressTimestamp
eventPoint.pressure
eventPoint.rotation
eventPoint.sceneGrabPosition
eventPoint.sceneLastPosition
eventPoint.scenePosition
eventPoint.pressTimestamp
eventPoint.scenePressPosition
eventPoint.state
eventPoint.timeHeld
eventPoint.timestamp
eventPoint.uniqueId
eventPoint.velocity
State supports the following values:
| 常量 | 描述 |
|---|---|
EventPoint.Unknown
|
Unknown state; same as Qt.TouchPointUnknownState |
EventPoint.Stationary
|
The event point did not move; same as Qt.TouchPointStationary |
EventPoint.Pressed
|
The touch point or button is pressed; same as Qt.TouchPointPressed |
EventPoint.Updated
|
The event point was updated; same as Qt.TouchPointMoved |
EventPoint.Released
|
The touch point or button was released; same as Qt.TouchPointReleased |
States 類型是 typedef 對於 QFlags<State> . It stores an OR combination of State values. See also QEventPoint::States
TapHandler { gesturePolicy: TapHandler.ReleaseWithinBounds // exclusive grab on press onGrabChanged: (transition, eventPoint) => { switch (transition) { case PointerDevice.GrabExclusive: console.log("took exclusive grab of point", eventPoint.id, "on", eventPoint.device.name) break case PointerDevice.UngrabExclusive: console.log("gave up exclusive grab of point", eventPoint.id, "on", eventPoint.device.name) break case PointerDevice.CancelGrabExclusive: console.log("exclusive grab of point", eventPoint.id, "on", eventPoint.device.name, "has been cancelled") break } switch (eventPoint.state) { case EventPoint.Pressed: console.log("on press @", eventPoint.position); break case EventPoint.Updated: console.log("on update @", eventPoint.position); break case EventPoint.Released: console.log("on release @", eventPoint.position); break default: console.log(eventPoint.position, "state", eventPoint.state) break } } }
另請參閱 handlerPoint .