aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
Commit message (Collapse)AuthorAgeFilesLines
* tst_flickableinterop: test buttons with all gesturePolicy valuesShawn Rutledge2017-05-151-1/+1
| | | | | Change-Id: If3d9e10bb54fc75a7e72bc6367de3e083611a45f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* DragHandler: allow parent to be different from targetShawn Rutledge2017-04-271-7/+9
| | | | | | | | | | | | | | | 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>
* QQMultiPointerHandler: don't steal grab if keepMouseGrab/keepTouchGrabShawn Rutledge2017-04-271-0/+1
| | | | | | | | | | An Item (such as MPTA with onGestureStarted: gesture.grab()) may set these flags, traditionally to prevent Flickable from stealing the grab. QQuickMultiPointerHandler (and thus PinchHandler) now respects these flags too. Change-Id: Iac3ab796c5aa410be45639d679ecf82b7c44a442 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* add pinchDragFlingMPTA exampleShawn Rutledge2017-04-251-0/+97
| | | | | | | | | | | | | | | 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>
* QQuickPointerDeviceHandler: add acceptedModifiersShawn Rutledge2017-04-252-0/+59
| | | | | | | | | 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>
* PH manual tests: better object names for easier debuggingShawn Rutledge2017-04-202-1/+3
| | | | | Change-Id: Icd5b9dc5fa00c98cc40b03e9d72f6b28fc51a579 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* PinchHandler: add centroidVelocityShawn Rutledge2017-04-201-0/+7
| | | | | Change-Id: I34cc9146155bded8311c1173e4b8d34d8b17b034 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2017-04-135-791/+2
|\ | | | | | | Change-Id: Ie2894830470a69827d4ace3d8af9bee971e3fbd4
| * Run ES5 tests on Linux/x86-64Simon Hausmann2017-03-244-641/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires including the test suite as a submodule by default and bumping the module to a new sha1 that removes some particularly long paths. Also force the test suite to run under a US locale, as tests like ch15/15.5/15.5.4/15.5.4.7/S15.5.4.7_A1_T11 cannot deal with locale dependent output for date formatting. The test harness now returns a non-zero exit code when a test fails. This is used by the QTestLib wrapper to determine success or failure. The tests with JIT are run, but the tests with the interpreter are omitted at the moment until the last failure is fixed. The tests add about 10-15 minutes extra time to the total time it takes to run tests on Linux in the CI. Change-Id: Id01fd3b41350f9c9a6ce9e43236f51f7f0fb71c8 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| * QHash: use the public functions to set the global hash seedThiago Macieira2017-03-161-3/+2
| | | | | | | | | | | | Task-number: QTBUG-47566 Change-Id: I4a7dc1fe14154695b968fffd14abd2e3189c6ad2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Red frame indicates that the item has an active handlerJan Arve Saether2017-03-091-1/+8
| | | | | | | | | | Change-Id: I360063f3fe80eefb112b348d1b93f38d34416696 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | add ScrollBar manual testShawn Rutledge2017-03-073-0/+190
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | TapHandler manual test: demonstrate tapped signalShawn Rutledge2017-03-072-7/+8
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2017-03-021-0/+147
|\ \ | | | | | | | | | Change-Id: I7e43a0a47d49de38617f6afc7548f9a9e212a851
| * | ObjectPrototype: Improve ES6 complianceRobin Burchell2017-02-071-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * getPrototypeOf: Per 19.1.2.9, we should ToObject(O), and ReturnIfAbrupt * getOwnPropertyDescriptor: Per 19.1.2.6, we should ToObject(O), and ReturnIfAbrupt * getOwnPropertyNames: Per 19.1.2.8.1, we should ToObject(O) and ReturnIfAbrupt * seal: Per 1.9.2.17, if Type(O) is not Object, return O * freeze: Per 1.9.2.5, if Type(O) is not Object, return O * preventExtensions: Per 19.1.2.15, if Type(O) is not Object, return O * isSealed: Per 19.1.2.13, if Type(O) is not Object, return true * isFrozen: Per 19.1.2.12, if Type(O) is not Object, return true * isExtensible: Per 19.1.2.11, if Type(O) is not Object, return false * keys: Per 19.1.2.14, we should ToObject(O), and ReturnIfAbrupt This improves the ES6 passrate for test/built-ins/Object/ quite a bit, before: === Summary === - Ran 6144 tests - Passed 5719 tests (93.1%) - Failed 425 tests (6.9%) After: === Summary === - Ran 6144 tests - Passed 5769 tests (93.9%) - Failed 375 tests (6.1%) ... and also fixes numerous tests in other areas. Most of the missing failures seem to be down to missing Object.assign & Symbol. It does regress on some ES5 tests that specifically check for the ES5 spec behavior. Change-Id: I039a223060c79c5bf4f5b041ad1ec4dc1afd5932 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | DatePrototype: In ES6, this is an Object, not a DateObjectRobin Burchell2017-02-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quoting 20.3.4: The Date prototype object is the intrinsic object %DatePrototype%. The Date prototype object is itself an ordinary object. It is not a Date instance and does not have a [[DateValue]] internal slot. Aside from Symbol failures (which we expect, because we don't have a Symbol implementation at this time), Date.prototype only has these two failures left in ES6: setFullYear/new-value-time-clip in strict mode setFullYear/new-value-time-clip in non-strict mode setMonth/new-value-time-clip in strict mode setMonth/new-value-time-clip in non-strict mode These seem to be related to handling of overflow conditions. Change-Id: I0b7f65fbef3f709ff56ecfc8e5a5d5cf974b7515 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Date.prototype: Fixes for ES6 complianceRobin Burchell2017-02-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Don't return -0 from TimeClip (20.3.1.15, 1) * Mark length configurable (19.2.4.1) * toUTCString and toGMTString must be the the same object (B.2.4.3) Brings us a bit closer to passing tests. Still some failures in other areas. Change-Id: I905216b8653ac0b33cb27e6b773616521fbb5daa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | ObjectPrototype: Object.freeze() no longer sets TypeError for a non-ObjectRobin Burchell2017-02-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a behavior change in ES6. Refer to: 19.1.2.5 (Object.freeze) Annex E (Additions and Changes That Introduce Incompatibilities with Prior Editions) ES6 tests test/built-ins/Object/freeze before: === Summary === - Ran 92 tests - Passed 66 tests (71.7%) - Failed 26 tests (28.3%) after: === Summary === - Ran 92 tests - Passed 76 tests (82.6%) - Failed 16 tests (17.4%) Change-Id: Ia28da790b510580248056e0df7b305a5edc470dd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | FunctionObject: Mark name/length property configurableRobin Burchell2017-02-031-0/+98
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In ES5, these were not configurable, but ES6 changed the behavior. For length, refer to: 9.2.4 (FunctionInitialize) 17 (ECMAScript Standard Built-in Objects): Unless otherwise specified, the length property of a built-in Function object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. 19.2.2.1 Function.length 19.2.3.2 (Function.prototype.bind) 19.2.4.1 (Function instances, length) For name, refer to: 9.2.11 (SetFunctionName) This does regress test262 for ES5 for me a little, but improves our es6 test coverage a bit (~682 more tests pass, +1.5%). Change-Id: Icda7c9068dc3e6e4e4aebbb0d359868a30343013 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | flickableWithHandlers manual test improvementsShawn Rutledge2017-02-223-21/+47
| | | | | | | | | | | | | | | | 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>
* | allow stealing grab from handlers; notify passive grabbers when stolenShawn Rutledge2017-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | pointer handlers manual test: can give arg with qml to launchShawn Rutledge2017-02-142-0/+16
| | | | | | | | | | | | | | | | | | 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>
* | TapHandler: add timeHeld propertyShawn Rutledge2017-02-091-1/+15
| | | | | | | | | | | | | | It enables long-press gestures to have continuous feedback. Change-Id: Idd0838aff6213ebfc2fce66639bbc932e77208b4 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | TapHandler: add gesturePolicyShawn Rutledge2017-02-0911-2/+290
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | TapHandler: add long-press featureShawn Rutledge2017-02-091-5/+14
| | | | | | | | | | | | | | | | 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>
* | add flickableWithHandlers manual testShawn Rutledge2017-02-095-0/+464
| | | | | | | | | | | | | | | | 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>
* | Introduce TapHandlerShawn Rutledge2017-02-083-0/+138
| | | | | | | | | | | | | | | | | | 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>
* | add modified photosurface as a manual testShawn Rutledge2017-02-083-1/+178
| | | | | | | | | | | | | | | | 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>
* | add FakeFlickable manual testShawn Rutledge2017-02-084-0/+180
| | | | | | | | | | | | | | | | 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>
* | add MomentumAnimation as a manual test / experimentShawn Rutledge2017-02-084-0/+158
| | | | | | | | | | | | | | | | It could be exposed as a new type of animation, but for now it's just an experiment. Change-Id: Ic900752a90ccae93270e27399f370f5d47495f74 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2017-01-268-31/+384
|\| | | | | | | Change-Id: I7962fd2282792c43af69784c8e98fb050fd928a7
| * test262: Allow specifying a custom V4CMDRobin Burchell2017-01-191-1/+1
| | | | | | | | | | | | | | | | Useful for running a test tree against different qmljs or if qmljs is outside PATH. Change-Id: Ibaa24a15d32b21f9293db2c042fe3f1de3bb75eb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * MultiPointTouchArea.TouchPoint: add rotation, uniqueId and ellipseDiametersShawn Rutledge2017-01-041-21/+63
| | | | | | | | | | | | | | | | | | So far uniqueId and rotation are mainly applicable to TUIO. Deprecate the area property in favor of ellipseDiameters. Also improve the mpta-crosshairs manual test to show this information. Change-Id: I16ea6618ae21ce66dac45638d6e2bb3c0a3b1818 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * mpta-crosshairs manual test: correct the velocity vector rotationShawn Rutledge2017-01-041-1/+2
| | | | | | | | | | | | | | acos cannot return any possible angle, but atan2 can. Change-Id: Ic277bc1d3616900775b6076dce6b05bdf3c35da3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * add text manual testShawn Rutledge2016-12-316-0/+321
| | | | | | | | | | | | | | | | | | The initial goal is to verify the behavior of text, preeditText and displayText properties and their associated signals on various platforms. Change-Id: Ie50c78a83930e05158a197f38087db9ae3cba534 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | QQPSingleHandler: copy some values from QQuickEventPoint to propertiesShawn Rutledge2017-01-039-0/+171
| | | | | | | | | | | | | | | | | | We can't copy the eventpoint and we can't continue to refer to it after delivery, either. So we can't have an event property. Some QML use cases depend on being able to access last-known values between events. Change-Id: Ice8a1763015f2554275d0cb76824fd0366eaef56 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Add a DragHandler::translation propertyJan Arve Saether2016-12-293-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the application developer to get the translation of the dragged pointer, and apply it in a custom way. This should usually be combined with setting target to null. This will for instance be needed when we want to drag QtLocations map, where a map is dragged by specifying the geo location of the center of the map. The map2.qml example demonstrates this. Change-Id: I652d9fc92fa9b6dfd3796c7147832f25af0cc5bc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | DragHandler active property replaces dragging; same as grabbingShawn Rutledge2016-12-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Let pinchhandler operate on QQuickItem propertiesJan Arve Saether2016-12-271-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2016-12-202-0/+28
|\| | | | | | | Change-Id: I9ed2e696108f11c9153012fcf092541fd0e0d7c8
| * Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-232-0/+28
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4object_p.h Change-Id: Iff4d3aba7710a999b8befdc493cbe959e1ce02f9
| | * Fix flow text objects in beginning of RTL blockEskil Abrahamsen Blomfeldt2016-11-142-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the block is right-to-left and starts with a text object, it should be aligned to the right edge of the QTextLine instead of the left one. [ChangeLog][QtQuick][Text] Fixed placement of flowing text objects in the start of a right-to-left block. Task-number: QTBUG-43133 Change-Id: Id790e88f3464280f124c38b4260386b84cac8826 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Fixed some problems with the centroid in PinchHandlerJan Arve Saether2016-11-201-44/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2016-11-172-1/+20
|\| | | | | | | | | | | | | | | | | We no longer have any hope of getting this into 5.8. Change-Id: I2decfa47e589ba7ae2d6b951c6517a2c311d0192
| * | Add ECMAScript 6 Array find and findIndex methodsKai Uwe Broulik2016-11-101-1/+2
| |/ | | | | | | | | Change-Id: I318fa243ab68b8a714923ab816d62e8c544fca8c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Merge remote-tracking branch 'origin/5.7' into 5.8v5.8.0-beta1Liang Qi2016-10-271-0/+18
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: I0b9e5bea5da5d2666887c202e62d889b4aa56900
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-271-0/+18
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickwindow.cpp tests/auto/quick/qquicktext/BLACKLIST tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: I8bd68b0b5e853b7908791d2cbddd18dd527c76ae
| | | * Add a test for bitmap font rendering in Qt QuickEskil Abrahamsen Blomfeldt2016-10-251-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "fixedsys" font is available on Windows at least, so while this test may not add any value on other platforms, it won't hurt either, and this was something that regressed on Windows before. Task-number: QTBUG-56659 Change-Id: Id01dedcbdc2fe74027caf31dd0dde6729ade8c63 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | | Fix rotation in PinchHandlerJan Arve Saether2016-09-161-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Move device id to be in bits 24-31 of the point idJan Arve Saether2016-09-161-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us for lossless conversion between QTouchEvent::TouchPoint id and QQuickEventPoint::pointId (both ways). Change-Id: I2087847a579dd8bc5b526515ad07b55c9ae8aa42 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>