aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-09-10 15:37:34 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-09-14 07:55:02 +0000
commit0a3eec60cab3c453b378ee45ac335e0dc2951f4b (patch)
tree652d937937390350f5be164ab5132261b3145f6b /src/quick/handlers
parent983c036972248c1eb94a0df196951f15210cd71e (diff)
Doc: fix grabPermissions and other enumeration properties
* grabPermissions is a flags property, not bool. * Add a list of the possible grabPermissions values. * Fix two other places where \qmlproperty enum was used instead of enumeration. * acceptedButtons, acceptedDevices, acceptedModifiers and acceptedPointerTypes are flags properties, not plain int. Change-Id: I6f49dcc1e1762e913e4989b208380d64899630a6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r--src/quick/handlers/qquickhandlerpoint.cpp4
-rw-r--r--src/quick/handlers/qquickpointerdevicehandler.cpp8
-rw-r--r--src/quick/handlers/qquickpointerhandler.cpp23
3 files changed, 27 insertions, 8 deletions
diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp
index 00347245ee..6a106b5464 100644
--- a/src/quick/handlers/qquickhandlerpoint.cpp
+++ b/src/quick/handlers/qquickhandlerpoint.cpp
@@ -269,7 +269,7 @@ void QQuickHandlerPoint::reset(const QVector<QQuickHandlerPoint> &points)
/*!
\readonly
- \qmlproperty enum QtQuick::HandlerPoint::pressedButtons
+ \qmlproperty enumeration QtQuick::HandlerPoint::pressedButtons
\brief Which mouse or stylus buttons are currently pressed
\sa MouseArea::pressedButtons
@@ -277,7 +277,7 @@ void QQuickHandlerPoint::reset(const QVector<QQuickHandlerPoint> &points)
/*!
\readonly
- \qmlproperty enum QtQuick::HandlerPoint::modifiers
+ \qmlproperty enumeration QtQuick::HandlerPoint::modifiers
\brief Which modifier keys are currently pressed
This property holds the keyboard modifiers that were pressed at the time
diff --git a/src/quick/handlers/qquickpointerdevicehandler.cpp b/src/quick/handlers/qquickpointerdevicehandler.cpp
index 24b3dc4733..096fad2071 100644
--- a/src/quick/handlers/qquickpointerdevicehandler.cpp
+++ b/src/quick/handlers/qquickpointerdevicehandler.cpp
@@ -80,7 +80,7 @@ QQuickPointerDevice::PointerTypes QQuickPointerDeviceHandler::acceptedPointerTyp
}
/*!
- \qmlproperty int QtQuick::PointerDeviceHandler::acceptedButtons
+ \qmlproperty flags QtQuick::PointerDeviceHandler::acceptedButtons
The mouse buttons which can activate this Pointer Handler.
@@ -131,7 +131,7 @@ Qt::KeyboardModifiers QQuickPointerDeviceHandler::acceptedModifiers() const
}
/*!
- \qmlproperty int PointerDeviceHandler::acceptedDevices
+ \qmlproperty flags PointerDeviceHandler::acceptedDevices
The types of pointing devices that can activate this Pointer Handler.
@@ -167,7 +167,7 @@ void QQuickPointerDeviceHandler::setAcceptedDevices(QQuickPointerDevice::DeviceT
}
/*!
- \qmlproperty int PointerDeviceHandler::acceptedPointerTypes
+ \qmlproperty flags PointerDeviceHandler::acceptedPointerTypes
The types of pointing instruments (finger, stylus, eraser, etc.)
that can activate this Pointer Handler.
@@ -206,7 +206,7 @@ void QQuickPointerDeviceHandler::setAcceptedPointerTypes(QQuickPointerDevice::Po
}
/*!
- \qmlproperty int PointerDeviceHandler::acceptedModifiers
+ \qmlproperty flags PointerDeviceHandler::acceptedModifiers
If this property is set, it will require the given keyboard modifiers to
be pressed in order to react to pointer events, and otherwise ignore them.
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 9b8281b519..12c06aa179 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -256,14 +256,33 @@ bool QQuickPointerHandler::approveGrabTransition(QQuickEventPoint *point, QObjec
}
/*!
- \qmlproperty bool QtQuick::PointerHandler::grabPermission
+ \qmlproperty flags QtQuick::PointerHandler::grabPermissions
This property specifies the permissions when this handler's logic decides
to take over the exclusive grab, or when it is asked to approve grab
takeover or cancellation by another handler.
+ \value PointerHandler.TakeOverForbidden
+ This handler neither takes from nor gives grab permission to any type of Item or Handler.
+ \value PointerHandler.CanTakeOverFromHandlersOfSameType
+ This handler can take the exclusive grab from another handler of the same class.
+ \value PointerHandler.CanTakeOverFromHandlersOfDifferentType
+ This handler can take the exclusive grab from any kind of handler.
+ \value PointerHandler.CanTakeOverFromAnything
+ This handler can take the exclusive grab from any type of Item or Handler.
+ \value PointerHandler.ApprovesTakeOverByHandlersOfSameType
+ This handler gives permission for another handler of the same class to take the grab.
+ \value PointerHandler.ApprovesTakeOverByHandlersOfDifferentType
+ This handler gives permission for any kind of handler to take the grab.
+ \value PointerHandler.ApprovesTakeOverByItems
+ This handler gives permission for any kind of Item to take the grab.
+ \value PointerHandler.ApprovesCancellation
+ This handler will allow its grab to be set to null.
+ \value PointerHandler.ApprovesTakeOverByAnything
+ This handler gives permission for any any type of Item or Handler to take the grab.
+
The default is
- \c {CanTakeOverFromItems | CanTakeOverFromHandlersOfDifferentType | ApprovesTakeOverByAnything}
+ \c {PointerHandler.CanTakeOverFromItems | PointerHandler.CanTakeOverFromHandlersOfDifferentType | PointerHandler.ApprovesTakeOverByAnything}
which allows most takeover scenarios but avoids e.g. two PinchHandlers fighting
over the same touchpoints.
*/