@@ -66,7 +66,8 @@ QT_BEGIN_NAMESPACE
66
66
PointHandler will not automatically manipulate the \c target item in any way.
67
67
You need to use bindings to make it react to the \l point.
68
68
69
- \note On macOS, PointHandler does not react to the trackpad by default.
69
+ \note On macOS, PointHandler does not react to multiple fingers on the
70
+ trackpad by default, although it does react to a pressed point (mouse position).
70
71
That is because macOS can provide either native gesture recognition, or raw
71
72
touchpoints, but not both. We prefer to use the native gesture event in
72
73
PinchHandler, so we do not want to disable it by enabling touch. However
@@ -75,7 +76,7 @@ QT_BEGIN_NAMESPACE
75
76
want to react to all the touchpoints but do not require the smooth
76
77
native-gesture experience.
77
78
78
- \sa MultiPointTouchArea, {Pointer Handlers Example}
79
+ \sa MultiPointTouchArea, HoverHandler, {Pointer Handlers Example}
79
80
*/
80
81
81
82
QQuickPointHandler::QQuickPointHandler (QQuickItem *parent)
@@ -128,6 +129,127 @@ QVector2D QQuickPointHandler::translation() const
128
129
return QVector2D (point ().position () - point ().pressPosition ());
129
130
}
130
131
132
+ /* !
133
+ \qmlproperty flags PointHandler::acceptedButtons
134
+
135
+ The mouse buttons that can activate this PointHandler.
136
+
137
+ By default, this property is set to \l {QtQuick::MouseEvent::button} {Qt.LeftButton}.
138
+ It can be set to an OR combination of mouse buttons, and will ignore events
139
+ in which other buttons are pressed or held.
140
+
141
+ \snippet pointerHandlers/pointHandlerAcceptedButtons.qml 0
142
+
143
+ \note On a touchscreen, there are no buttons, so this property does not
144
+ prevent PointHandler from reacting to touchpoints.
145
+ */
146
+
147
+ /* !
148
+ \qmlproperty flags PointHandler::acceptedDevices
149
+
150
+ The types of pointing devices that can activate this PointHandler.
151
+
152
+ By default, this property is set to
153
+ \l{QInputDevice::DeviceType}{PointerDevice.AllDevices}.
154
+ If you set it to an OR combination of device types, it will ignore events
155
+ from non-matching \l {PointerDevice}{devices}:
156
+
157
+ \snippet pointerHandlers/pointHandler.qml 1
158
+ */
159
+
160
+ /* !
161
+ \qmlproperty flags PointHandler::acceptedPointerTypes
162
+
163
+ The types of pointing instruments (finger, stylus, eraser, etc.)
164
+ that can activate this PointHandler.
165
+
166
+ By default, this property is set to
167
+ \l {QPointingDevice::PointerType} {PointerDevice.AllPointerTypes}.
168
+ If you set it to an OR combination of device types, it will ignore events
169
+ from non-matching \l {PointerDevice}{devices}:
170
+
171
+ \snippet pointerHandlers/pointHandlerCanvasDrawing.qml 0
172
+
173
+ The \l {Pointer Handlers Example} includes a more complex example for
174
+ drawing on a Canvas with a graphics tablet.
175
+ */
176
+
177
+ /* !
178
+ \qmlproperty flags PointHandler::acceptedModifiers
179
+
180
+ If this property is set, PointHandler requires the given keyboard modifiers
181
+ to be pressed in order to react to \l {PointerEvent}{PointerEvents}, and
182
+ otherwise ignores them.
183
+
184
+ If this property is set to \c Qt.KeyboardModifierMask (the default value),
185
+ then PointHandler ignores the modifier keys.
186
+
187
+ For example, an \l [QML] Item could have two handlers, one of which is
188
+ enabled only if the required keyboard modifier is pressed:
189
+
190
+ \snippet pointerHandlers/pointHandlerAcceptedModifiers.qml 0
191
+
192
+ If you set \c acceptedModifiers to an OR combination of modifier keys,
193
+ it means \e all of those modifiers must be pressed to activate the handler.
194
+
195
+ The available modifiers are as follows:
196
+
197
+ \value NoModifier No modifier key is allowed.
198
+ \value ShiftModifier A Shift key on the keyboard must be pressed.
199
+ \value ControlModifier A Ctrl key on the keyboard must be pressed.
200
+ \value AltModifier An Alt key on the keyboard must be pressed.
201
+ \value MetaModifier A Meta key on the keyboard must be pressed.
202
+ \value KeypadModifier A keypad button must be pressed.
203
+ \value GroupSwitchModifier X11 only (unless activated on Windows by a command line argument).
204
+ A Mode_switch key on the keyboard must be pressed.
205
+ \value KeyboardModifierMask The handler does not care which modifiers are pressed.
206
+
207
+ \sa Qt::KeyboardModifier
208
+ */
209
+
210
+ /* !
211
+ \readonly
212
+ \qmlproperty bool PointHandler::active
213
+
214
+ This holds \c true whenever the constraints are satisfied and this
215
+ PointHandler is reacting. This means that it is keeping its properties
216
+ up-to-date according to the movements of the \l {eventPoint}{eventPoints}
217
+ that satisfy the constraints.
218
+ */
219
+
220
+ /* !
221
+ \internal
222
+ \qmlproperty flags PointHandler::dragThreshold
223
+
224
+ This property is not used in PointHandler.
225
+ */
226
+
227
+ /* !
228
+ \qmlproperty real PointHandler::margin
229
+
230
+ The margin beyond the bounds of the \l {PointerHandler::parent}{parent}
231
+ item within which an \l eventPoint can activate this handler.
232
+
233
+ The default value is \c 0.
234
+
235
+ \snippet pointerHandlers/pointHandlerMargin.qml 0
236
+ */
237
+
238
+ /* !
239
+ \qmlproperty real PointHandler::target
240
+
241
+ A property that can conveniently hold an Item to be manipulated or to show
242
+ feedback. Unlike other \l {Qt Quick Input Handlers}{Pointer Handlers},
243
+ PointHandler does not do anything with the \c target on its own: you
244
+ usually need to create reactive bindings to properties such as
245
+ \l SinglePointHandler::point and \l PointHandler::active. If you declare
246
+ an Item instance here, you need to explicitly set its \l {Item::}{parent},
247
+ because PointHandler is not an Item.
248
+
249
+ By default, it is the same as the \l {PointerHandler::}{parent}, the Item
250
+ within which the handler is declared.
251
+ */
252
+
131
253
QT_END_NAMESPACE
132
254
133
255
#include " moc_qquickpointhandler_p.cpp"
0 commit comments