| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QQuickItemPrivate::data_append() was not invoked when any kind of
Pointer Handler was directly declared in a Flickable (or subclass)
because QQuickFlickable redefines the default property to be its own
flickableData property. So we need to repeat the special handling
in QQuickFlickablePrivate::data_append() too. The handler must
be added to the private->extra->pointerHandlers vector, so that
QQuickItemPrivate::handlePointerEvent() will attempt to deliver
events to those handlers.
TapHandler seems OK (especially with its default gesturePolicy
so that it does not do an exclusive grab).
PointHandler seems OK.
DragHandler competes with Flickable for the exclusive grab.
pressDelay can help; or set acceptedDevices: PointerDevice.Mouse
to allow the mouse to drag but not flick, and the touchscreen
to flick but not drag.
Fixes: QTBUG-71918
Fixes: QTBUG-73035
Change-Id: Icb97ed5230abe0cb6ec0230b5b5759a0528df7e8
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
The name indicates that it should test a SinglePointHandler, which
DragHandler no longer is.
Change-Id: I3c585b43c1334cf6794a98c92f742f92243adac8
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
| |
Change-Id: I16356ee214c80ff23c6b520c7ad492f86d85f986
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
..when dragging (translation) is disabled
In order to do this, we had to integrate QQuickAxis to the PinchHandler
which allows enabling/disabling x and y axis individually.
This allows us to have one item with PinchHandler with translation
disabled (but to only handle rotate and scale) together with a two-finger
drag handler.
Change-Id: I1581c575ffba2e5d007163bec36e5699bdd86cbc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Any JS callback using one of these signals probably needs to know
which button was tapped. We do not want to require
TapHandler.point.pressedButtons to tell a lie (temporarily hold the
previous state even though a button was actually released). We could
add a releasedButtons property, but it would be a bit weird to have it
holding state indefinitely between events. We could add just a button
parameter to these signals, which would not be so bad, but emitting
the whole eventPoint opens up other possibilities, like doing
filtering in JS based on the device.
To be able to get the device property of the event in QML, it must
not be a const pointer. Q_PROPERTY(const type* ...) is so far
unprecedented in Qt Quick; and the device has only const properties
anyway.
This reverts 8dc02aab72a714b5195ccc641fbfb534c3ae9e98
Task-number: QTBUG-61749
Task-number: QTBUG-64847
Change-Id: I09067498b22cc86e9f68c5ff13d6aa5447faba3d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is important in order for passive grabbers to be in the same order
as if the points were pressed at the same time.
In our case, the problem occurred when we had a single-point DragHandler
together with a two-finger PinchHandler:
* One finger was pressed and moved
=> DragHandler called setPassiveGrab()
=> point0->passiveGrabbers: [DragHandler]
* A second finger was pressed and moved
=> PinchHandler called setPassiveGrab() for both points
=> point0->passiveGrabbers: [DragHandler,PinchHandler]
=> point1->passiveGrabbers: [PinchHandler]
So then as one keeps on dragging the *two* fingers, the DragHandler will
get the chance to do an exclusive grab first, (since its the first listed
passive grabber of point0), and the PinchHandler won't get the opportunity
to grab. This is not expected since their declaration order implies that
the PinchHandler should get a chance to grab first.
Change-Id: I4e82ed186eeb5bf1dae1679d393e5563072175d1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
That is, minimumPointCount can now be set to a value > 1 to require
multiple fingers to do the dragging, or to track the displacement
of multiple fingers to adjust some value (such as the tilt of a map).
Task-number: QTBUG-68106
Change-Id: Ib35823e36deb81c8b277d3070fcc758c7c019564
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
| |
... and clean up imports in examples, snippets and tests accordingly.
Change-Id: I5bbe63afd2614cdc2c1ec7d179c9acd6bc03b167
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's not just useful for PinchHandler: TapHandler has a good use for it
too. But unfortunately if the handler's parent Item has a custom mask,
we don't have a way to augment the mask with a margin; so if margin is
set, we assume the bounds are rectangular.
QQuickMultiPointHandler::eligiblePoints() now calls wantsEventPoint()
rather than bounds-checking the point directly: this adds flexibility,
potentially allowing an override in subclasses, if we need it later.
Task-number: QTBUG-68077
Change-Id: I65c95f00c532044a5862654e58c9c5f8c973df81
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Detect whether the handler's parent contains the mouse, while the
point property tracks the event point (position etc.)
Task-number: QTBUG-68072
Change-Id: Ica99332596eab3e344852a11f1ceb7aaf6348c86
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you want to set target: null and then bind scale to some sort of
rendering scale property directly, it's a lot less trouble if the
scale property does not keep changing back to 1.0 every time a gesture
begins. Added an activeScale property to represent that value, the
one that the scale property had before.
Task-number: QTBUG-68941
Change-Id: Idcb6735d915a523afe1a948609080af7a83f82ad
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
The event includes it; this exposes it to QML, for the benefit of
conditional JS logic in Pointer Handler use cases.
Task-number: QTBUG-68101
Change-Id: I3f04c5db7f5aef461edb6168922b70e3fb3bda37
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One of the reasons we were so fond of using SinglePointHandler for the
"simple" handlers like TapHandler and DragHandler is that it has the
point property, which is easy to bind to in QML. But multi-point
handlers tend to use the centroid as the focal point or fulcrum of
the transformation, so exposing the centroid as a QQuickHandlerPoint
gadget rather than just a QPointF has all the same advantages as the
point property in SinglePointHandler, including letting the
QQuickHandlerPoint instance store state between events (press
position, grab position, last known position etc.)
Change-Id: I4a955fa21b54b7ebb50b0ee2c942fb98eeccb560
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We already had a manual test using a slider, but that has only
one combination of DragHandler and TapHandler.
This test aims to test all possible combinations of DragHandler and
TapHandler together (as siblings, in different parts of the hierarcy,
with a Flickable beneath...)
We also show the current grabbers as an overlay over this entire
collection of manual tests.
Change-Id: Ic634d36d14f7456170f43b077fa72b03fb65bc18
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Just like the one at the bowling alley... no actually the problem was
that it's easy to fling the balls right out of the window, and we
don't have collision detection so we can't make them bounce. Now
they simply come back "home" after a delay.
Change-Id: I297828321fce975b929e449e56799fd9280b682d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
| |
The reason for using SVG is to be able to render it quickly at lower
resolutions but with higher quality after zooming in, and it's good
to have an example which demonstrates how.
Change-Id: I04107b724ef5c844c8b3eaa2f46750bd66d7d718
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
It's currently not possible to see which button was tapped, in
JavaScript. 8dc02aab72a714b5195ccc641fbfb534c3ae9e98 broke it.
Task-number: QTBUG-64847
Change-Id: I1020a8fa5732230d579ee7785e51b0e297df71b0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
Otherwise the map example doesn't work when installing into app
packages, because the svg plugin doesn't get included.
Task-number: QTBUG-64851
Change-Id: I6674b8e4175262dfed74144280470c3e6b4c1524
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I598093647da3aba291945819d7c396a247fddf52
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I7f4783b6f9a5237ef6b8ae1a89fedaf9cdadffc5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
| |
The background image is a POV-ray rendering which makes it look a bit
more like an actual joystick (but there's still no tilting stem under
the knob).
Change-Id: I9d130d6fcd72715733678a525c69785e5f1a52ea
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: Ib1fe267c23ea9fce9bcc0a91ed61081260338460
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
|
|
|
|
|
|
| |
grabPermissions are OK by default.
Change-Id: I1e9564415a12e4cd7a9213d11e5374d619239099
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
even if all points are accepted or grabbed. A passive grab isn't much
good if there are cases where the handler is prevented from monitoring.
This enables e.g. the PinchHandler to steal the grab when the right
number of touchpoints are present and have moved past the drag threshold,
and enables completion of a couple of autotests.
Change-Id: I78dc6fc585f80bfb3c13e0c6e757ef815fb94afe
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
This is more flexible in case someone wants a PinchHandler to respond
in the same way for either 2 or 3 touchpoints, for example.
Change-Id: I360ce6f0239d86aa92dbebc225e3646883e71100
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
This is for the sake of convention. Unfortunately (and the reason
it wasn't done this way at the outset), it may prevent us from ever
having a signal called "pressed" in this handler or its base class.
Change-Id: Iafa117410e0e33562290b87df59bc8c0085c217d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
If you flick in such a way that y is within bounds but x is out of
bounds, then returnToBounds should not change y; and vice-versa.
Change-Id: I156a2f6e28bdcd6aecce35e639acaa05e55ee382
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
After 2617ac5b9df7dfdecf0cb02d5933c40df1a55bbc the point.pos
properties are renamed.
We need to accept all buttons in order to show feedback for middle
and right clicks.
Change-Id: I2dce1b14c4ac94ffac7b8ed3ecc12938067a434c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
| |
Change-Id: I6af55e11f02592f122be54d3d235c69537f3f7fc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
| |
Change-Id: I80000110a2e0ca69210322a0fcc587d86158358e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
| |
It looks much nicer than just jerking back into position.
We still don't have "resistance" to dragging past the bounds, though.
Change-Id: I60f6f58fe87638fd17144ea6640bae673a3b633d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: If3d9e10bb54fc75a7e72bc6367de3e083611a45f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The most obvious way to implement a Slider is to allow dragging the
knob - as on a real-world physical sliding potentiometer. But to make
it easier on a touchscreen, it should be possible to touch anywhere
along the slider's travel, as on a QtQuick.Controls 2 Slider. For
that purpose, we need to respond to events within the bounds of one
Item while actually dragging a different Item (the knob). It's
similar to the way that PinchHandler can handle pinch gestures within
one Item while transforming another (which may be too small to get
both fingers inside).
Change-Id: Iac9a5f11a7a45e22d93fe52bf62d157c48d72d3d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a prototype of what 3-finger pinch is intended for:
manipulating a container exclusively with a 3-finger gesture while
not interfering at all with other gestures that occur inside the
container. And it's normal that existing Items (like MPTA) do
implicit grabs of touchpoints just by accepting, so this is also
a test of cooperation between PointerHandlers and legacy Areas.
It also adds the ability to drag the MPTA only while the Meta
key is held down. And there is momentum on release whether you
are doing a 3-finger pinch or via the DragHandler.
Change-Id: Icd0e84809ec32dc8f347dd9c8f875d10f52eba19
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
Sometimes you want to require holding down a key in order to enable
some interaction. As with the other "accepted" flags, it's better to
do this with a property than with Javascript.
Change-Id: Ie29880f5f9f496ddca1bee462e2c0e6dd30fa9f5
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
| |
Change-Id: Icd5b9dc5fa00c98cc40b03e9d72f6b28fc51a579
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I34cc9146155bded8311c1173e4b8d34d8b17b034
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I360063f3fe80eefb112b348d1b93f38d34416696
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It demonstrates that DragHandler's grabs work well enough, so that
you can grab the knob and drag it even while the cursor goes outside
the window. Also the TapHandler for detecting clicks or taps within
the "trough". And for completeness, the FakeFlickable example
needed scrollbars, to prove that it's possible to build all the
flicking and scrolling behaviors with only PointerHandlers.
Change-Id: I9d9323b1f583a02e0157edb85b6bffbe1652711f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Missiles are too expensive to launch in continuous sprays anyway.
Also, it's too hard to keep holding down the "balloons" button if
we use policy DragThreshold. This is better to have on the
fighters button, since the usual use case is that ballons are
launched first, and cheap enough to launch continuously.
Change-Id: I3b52556b81afad9fb7ec1a4b1dec4dde3bab104c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
Add it to main.qml and it and its dependencies to resources
Add checkbox to control Flickable's pressDelay
Change-Id: Ifaa4bbbaf61944231ab80cf356d7a3c44b24d73b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now if a Button with a TapHandler is pressed and has only a passive
grab, Flickable can take the exclusive grab, and it notifies the
TapHandler so that the button can go back to released state.
This reverts parts of commit e2fd141372335f917c2d216051abb00d8b15f87c
such that more of tst_PointerHandlers is working the same as it was
before we started adding the passive grab concept.
Change-Id: I88970716fcbbfb066a313fcefb233cf9263da944
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
This makes it easier to repeatedly launch the same test: specify
the qml file on the command line instead of having to click the
list item each time. e.g. ./pointer tapHandler.qml
Change-Id: I30b449b161107b1746418fc45518d202ba7d8381
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
| |
It enables long-press gestures to have continuous feedback.
Change-Id: Idd0838aff6213ebfc2fce66639bbc932e77208b4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now it behaved as if this was set to DragThreshold: give up on
the tap as soon as you are clearly dragging rather than tapping.
But that's not what is normally wanted when building a Button control,
for example. So provide 3 options: give up past the drag threshold,
when the pointer goes outside the bounds, or when it's released
outside the bounds. The longPressThreshold also constrains all
three cases: holding (or dragging) for too long will not result
in an immediate cancellation, but it also will not be a tap gesture.
Change-Id: I95aec978e783892b55371391a27642751d91d9ff
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
Add a longPressed signal, emitted when the point is held long enough.
Add the longPressThreshold to control how long that is.
Change-Id: I95a65f1e4c62eb41fb9ea02b14bdc3f16aa72ec2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
to verify that Flickable still works after the changes in event
delivery logic, even when it contains a mix of various Areas and Handlers.
Change-Id: Ibf68bc8b403718c87c7e647b17837f2a8e4e3f0e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
Device-agnostic tap/click detection. Also detect whether the
taps or clicks occur close enough together in both time and space
to be considered part of a multi-tap gesture.
Change-Id: I41a378feea3340b9f0409118273746a289641d6c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
This is a version of examples/quick/demos/photosurface updated to
use handlers instead of Areas.
Change-Id: I80a6c46f2ea4821097f3654cd885553aa484d405
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
| |
Demonstrate that DragHandler, MomentumAnimation and a couple of Items
are enough to implement most of Flickable's functionality.
Change-Id: I59dae38dc66c16813385aa6c00e3a1a834520f31
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|