| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/quick/handlers/qquickpinchhandler.cpp
Change-Id: I1f3618ceb93049623d6bf3a208b037c33d9d1f0c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This should have been done properly for 5.12.
Since this API was introduced in 5.12.0, we simply hide the
documentation for the old properties and make sure the properties we want
to expose are documented:
* Document the xAxis and yAxis properties.
* Deprecate the {min,max}imum{X,Y} properties, and hide them in the
documentation.
Fixes: QTBUG-73137
Change-Id: Ic749bcfec63dc4772f193ccae2a2750c20cb63aa
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|/
|
|
|
|
|
|
|
| |
- qreal<->float conversions are explicit
- use qFuzzyCompare rather than ==
- remove padding between variables (but the class still needs padding)
Change-Id: I9a9eb01f5a4108592b34e4b2f018c720ba19beb0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
| |
Change-Id: Ica67409f3138828d8a33fef2d67ad799a5a063f5
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
We didn't get around to implementing the appropriate behaviors.
We could add it back later if we figure out how.
Task-number: QTBUG-70292
Change-Id: Idca62b249f555d5e44bb97430ae0222bf314a66b
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Constructors should take QQuickItem* not QObject* to be symmetric
with the parentItem() accessor (and other code) which assumes its type
- Use header initialization everywhere possible
- Reorder variables to minimize padding (somewhat)
- Remove empty destructor bodies (the compiler can write them)
- Remove override and virtual from destructors in accordance with
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override
Change-Id: I682a53a803d65e29136bfaec3a5b534e975ecf30
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
macOS generates QNativeGestureEvents for 2-finger trackpad
zoom and rotation gestures. Now PinchHandler will react to them
in the same way that PinchArea does.
Change-Id: I4c7dab1d3561d20897e3671f4eb68d01ea06b9bd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
| |
This is in QQuickMultiPointHandler
Change-Id: Ia4ebb1731395733e2f76edd667330fa15de6f015
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
An example is forthcoming in the form of a documentation snippet.
Also, translation is a relative measurement, so its type is now
QVector2D rather than QPointF. This doesn't change the QML API:
x and y properties are still defined.
Change-Id: I00f9a02a45c30899a568fe827f47cae9b4cc0f42
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
| |
Renames:
QQuickPointerSingleHandler -> QQuickSinglePointHandler
QQuickMultiPointerHandler -> QQuickMultiPointHandler
Change-Id: I10c54944f85ca7cac374ebc6241d61793e2d38bf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I34cc9146155bded8311c1173e4b8d34d8b17b034
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I17b3865d70bdc07912d7454b459dea40b9c98df0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This requires coordinate system mapping that varies with the
transformOrigin.
The properties exposed from PinchHandler (rotation, scale and translation)
are currently relative to the point when the pinch became active.
(Therefore, rotation, will reset back to 0 when a new pinch is activated).
Its still unclear how the properties that limits the transform should
influence. With this patch, they are like this:
* {min,max}imumRotation applies to the actual rotation of the item.
* {min,max}imumScale applies to the actual scale of the item.
* {min,max}imum{X,Y} applies to the actual position of the item. (This has
some unfortunate side-effects when the item is scaled or rotated, since
the items actual position will change as it rotates)
In addition, the behavior described above means that the limits won't
have any effect if there is no target item.
Change-Id: I279fb03667cd75324e8337039ae2594658265d13
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and override it in PinchHandler. Many handlers will need to do
something in response to change in active state, so calling a virtual
when the state changes and overriding it in subclasses is more
efficient than for subclasses to connect to the activeChanged signal.
This also helps us control the signal emit order: the subclass can
deal with any consequences (such as changing its own properties) before
activeChanged is emitted.
Change-Id: I6d05643e8facfd1941aa9152de6865932edb1b3a
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The centroid was not always mapped to the correct coordinate system
In addition, the return value of startingCentroid() was not always
desirable, because its implementation calls sceneGrabPos(). We therefore
had to get the starting centroid by querying touchPointCentroid() whenever
the handler became active.
Change-Id: I69de6b832b9bda208fda4eb90a8a95cc975405c2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we want to allow rotation with more than 2 fingers, its not
straightforward to calculate the rotation angle, because we cannot anymore
calculate the angle between the two touchpoints.
The approach chosen was to calculate the angle between the centroid and
the touchpoints, and take the average between the angles.
Then, for the next event we calculated the new average of the angles.
However, this is not really reliable in some scenarios, suppose we have
these three angles:
0 120 240, avg = 360/3 = 120
next, touch points rotate clockwise with 2 degrees, and we get these
angles:
358 118 238, avg = 714/3 = 238
So, just by rotating all fingers by 2 degrees, we got a jump by 118
degrees "in average".
Instead we need to track the angles of *all* touch points, and when the
next touch event is received we calculate how much the angle has changed
per touch point. We then take the average of those angles as the effective
"rotation" of the PinchHandler
Change-Id: I2bfdf80b886751177efe81bcc7b698af0d2938e3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
Similar to PinchArea but with improvements:
- Allows rotating and scaling about an arbitrary point rather than the center
- It's possible to require more than 2 fingers. E.g. maybe you use
3 fingers to manage a window, 2 fingers to manipulate content inside.
This could be achieved with two independent PinchHandlers.
Change-Id: Ifd40cfee115d7bc298378b26a58318bea40a8230
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
|