Commit Graph

13 Commits

Author SHA1 Message Date
Lucie Gérard 9c5fc88388 Correct license for test files
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-27 10:32:21 +01:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Shawn Rutledge 5d45aa1a64 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>
2019-04-27 05:41:21 +00:00
Shawn Rutledge f1b4348dae fakeFlickable manual test: put the slider in a drawer
The main reason is that the drawer also demonstrates a different use
of the BoundaryRule (limiting drags, with springy endstops).

Change-Id: I958af65a857fda1b5b8dc1b135414799261afc1f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-04-27 03:50:00 +00:00
Shawn Rutledge 197c22be54 Get rid of Qt.labs.handlers import, merge into QtQuick 2.12
... and clean up imports in examples, snippets and tests accordingly.

Change-Id: I5bbe63afd2614cdc2c1ec7d179c9acd6bc03b167
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-07-17 15:11:51 +00:00
Kai Koehne 11d53337cf Fix outdated BSD license header
Change-Id: Ib1fe267c23ea9fce9bcc0a91ed61081260338460
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-11-15 17:54:35 +00:00
Shawn Rutledge a1b42f95a7 rename TapHandler.isPressed property to pressed
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>
2017-09-12 09:04:58 +00:00
Shawn Rutledge 80e5e6976a tst_flickableinterop: test buttons with all gesturePolicy values
Change-Id: If3d9e10bb54fc75a7e72bc6367de3e083611a45f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-05-15 17:22:01 +00:00
Shawn Rutledge 47479c0e96 DragHandler: allow parent to be different from target
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>
2017-04-27 16:10:53 +00:00
Shawn Rutledge 11034bd4ab PH manual tests: better object names for easier debugging
Change-Id: Icd5b9dc5fa00c98cc40b03e9d72f6b28fc51a579
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-20 18:40:01 +00:00
Shawn Rutledge cb78d5c91e TapHandler: add gesturePolicy
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>
2017-02-09 14:32:21 +00:00
Shawn Rutledge 871314ced8 DragHandler active property replaces dragging; same as grabbing
If a QQuickPointerSingleHandler grabs a point, it's definitely in the
active state: doing something with the point.  (The converse is not
always true though: e.g. TapHandler can sometimes detect a tap without
ever grabbing.)
In DragHandler, the "dragging" property means the same as "active":
we always grab when dragging, to be sure to get the updates.  So the
"dragging" property is removed because it's redundant.
In QQuickPointerHandler we don't say that "wanting" an event is the
same as being active, because 1) it won't necessarily grab right away
and 2) every handler which was active should "want" the release event,
yet it needs to setActive(false) as soon as it's done processing it.

Change-Id: Ie010db54714a7914109da6469e79865f9a0a18e4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2016-12-29 10:52:31 +00:00
Shawn Rutledge 124181973f Introduce DragHandler
A handler for dragging Items around by touch or mouse.

Change-Id: Id83fea568095eb6374f3f1abc6f550d81f3731df
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-08-26 13:05:35 +00:00