aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Touch child mouse filtering: pass not grabbed points inside item boundsFrederik Gladhorn2017-05-071-1/+2
| | | | | | | | | | | | | | c2ca2cbf04071ffb3aee6af8d5ab9084dfa1c091 started to restrict delivery of items in childMouseEventFilter by checking that we wouldn't deliver completely random points outside the item that were not grabbed by child items. That is generally correct. It did no longer send along touch points that had any other state but pressed but were inside when they had no grabber. That part was wrong, points must be sent along if they are not grabbed and inside the item. Task-number: QTBUG-60368 Change-Id: Ida24f5d2310d3b71db79ae5f95da2c57dcd3f150 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-111-1/+16
|\ | | | | | | Change-Id: Ib3d81ad33a6ba28d891da91271a64d5fcc4874e6
| * Fix touch event delivery in childMouseEventFilterFrederik Gladhorn2017-03-161-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | Since moving to pointer events, we would deliver all events inside the filter function. The expected behavior though is that only points that are already grabbed, pressed inside or grabbed by children would be seen by the filter function. This broke using multiple touch aware items at the same time (2 pinch areas for example). Change-Id: I42a430f196ebbcf0a83a6dc8aca319e433ad52ad Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickEvents: Fix documentation of types for MouseEvent and WheelEvent x/yRobin Burchell2017-03-201-4/+4
| | | | | | | | | | | | | | | | These types are qreal, not int. Change-Id: I26569c40825ce098ea095b3d9dc9b84eb3870c02 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-141-0/+1
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I9d87ed86e95b5901a86cc3aa65d7ac39b0b708c2
| * Added documentation for the GroupSwitchModifierKavindra Palaraja2017-01-051-0/+1
| | | | | | | | | | | | | | | | Used the default sentence from Qt::KeyboardModifier. Task-number: QTBUG-53211 Change-Id: If763ca1b8d9ee7dcfa511f3a19dd012aac4d4f9c Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-251-1/+1
|\| | | | | | | | | | | | | Conflicts: tools/qmlimportscanner/main.cpp Change-Id: I01e17581f6691a03f83788773364d0cf96319514
| * rename QPointerUniqueId -> QPointingDeviceUniqueIdShawn Rutledge2016-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | Several people agreed that the name was confusing and that this one is better. Task-number: QTBUG-54616 Change-Id: Ie9d24fc6e233949be36c8b6ee2650080a8a3506e Reviewed-by: Sune Vuorela <sune@vuorela.dk> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * comment out all uses of QPointerUniqueId temporarilyShawn Rutledge2016-12-041-1/+1
| | | | | | | | | | | | | | | | | | The next step is to rename it, but we do this first to avoid breaking CI while it's renamed in qtbase. Task-number: QTBUG-54616 Change-Id: Iae3a098b9ab5571599af838d19b1869b84b2165f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-181-0/+9
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4variantobject.cpp src/qml/types/qquickworkerscript.cpp src/quick/scenegraph/util/qsgdefaultpainternode_p.h tools/qmljs/qmljs.cpp Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
| * add qt.quick.pointer.grab logging category to track pointer grabShawn Rutledge2016-10-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the ultimate destination of all grab/ungrab functions, both the legacy ones in QQuickWindow and the potential replacements. Since we rearchitected event delivery significantly in 5.8, it will be important to debug any behavior change issues that arise in the field; and in many such cases it's important to track which eventpoint on which device is being grabbed by which item. It generates output like [ 2.012 D] QQuickEventPoint::setGrabber - "Advanced Silicon" point 1c1 Updated : grab QQuickItem(0) -> MapComponent_QMLTYPE_7(0x25d0900, parent=0x23cb430, geometry=0,0 360x620) [ 2.012 D] QQuickEventPoint::setGrabber - "core pointer " point 0 Updated : grab QQuickMouseArea_QML_10(0x25a3dd0, name="big MA", parent=0x25d0900, geometry=0,0 360x620) -> QQuickItem(0) Change-Id: Ic98c3c91c719b430590530ba8c5a7eff8063d330 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QQEventPoint debug operator: show pointId in hexShawn Rutledge2016-10-071-1/+1
|/ | | | | | | | Now that pointIds contain a bit-shifted device ID, it's easier to see the structure in hex. Change-Id: Ib2846ce0997ecbf01d6645466f33adcbec1c9b51 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Do not crash in debug operator<< when QQuickPointerDevice is nullptrFrederik Gladhorn2016-09-291-0/+4
| | | | | Change-Id: I89f5189ab2e73dcd1525abfda41bd7c637e3bf53 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-191-1/+1
|\ | | | | | | Change-Id: I326616356ee26d4532c6d57558c43c919f0a900d
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-181-1/+1
| |\ | | | | | | | | | Change-Id: I20c622263f40c322954328e4d10a8071db3ca6d1
| | * Doc: Change instances of 'OS X' to 'macOS'Topi Reinio2016-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change all occurrences where the Mac platform is discussed to use the macro \macos (defined in the documentation configuration in qtbase). Change-Id: Iea114ac73c01d74401bcd77373b41a825d2636c9 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Handle press events without release gracefullyFrederik Gladhorn2016-08-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the old code, touch point grabbers would be ignored in case of a press without release for a point. To make sure not to break existing bad test code or clash with broken devices, warn, but reset the grabber for new press events. Change-Id: Ia76ed4d3ee32c983c451f760837e83f8d90dab41 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Invalidate QQuickPointerEvents after deliveryFrederik Gladhorn2016-08-051-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | We must not hold on to events after delivery, so better set them to nullptr. On the other hand the grabbers need to be persistent, but that's achieved since the points are copied anyway. Change-Id: I0c01ee2ec6c9238c6594f0b7e2a9533185070667 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | QQuickEventPoint: replace Qt::TouchPointState with State enumShawn Rutledge2016-08-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This allows extension later on, and makes it clear that the state is for any kind of point, not just a touchpoint. Change-Id: I1f8aaa01ea65ac1731645129fedcf7a51ee66e77 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Remove silly newlinesFrederik Gladhorn2016-08-051-3/+0
| | | | | | | | | | | | | | | Change-Id: I35bd1aa524705c8c6541428b2737b992de2ad05d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Remove unused functionFrederik Gladhorn2016-08-051-10/+0
| | | | | | | | | | | | | | | Change-Id: I604fe1470bfab831e31d129d3b734213273fc333 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | add categorized logging of QQuickEventPoint::setAcceptedShawn Rutledge2016-08-041-1/+6
| | | | | | | | | | | | | | | | | | | | | The same category can be for pointer event handling verbose details. Change-Id: Ife75dcbead6e002c5845a9882950211efe53d4fa Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QQuickEvents: de-inline a few more functionsShawn Rutledge2016-08-041-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | Touching this header results in rebuilding a lot of stuff, and these functions are likely to need further modification. Change-Id: Idc99255fc8e20a190c31b5e3d47dd005f4573434 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Pass pointer event into sendFilteredTouchEventFrederik Gladhorn2016-08-031-2/+2
| | | | | | | | | | | | | | | Change-Id: Id8709b45af135df5f16558c4b611409bc134ea63 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Stop copying mouse events when delivering themFrederik Gladhorn2016-08-021-2/+4
| | | | | | | | | | | | | | | | | | | | | Reduce allocations of events, just refill the local pos. Change-Id: I2948faf0e302bff315e482f2c1432fe0def19bc5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Keep pointer to touch point that is accessed twiceFrederik Gladhorn2016-08-011-2/+3
| | | | | | | | | | | | | | | Change-Id: I460680e522ae8dd14b488ebba5e9608f9ce6ffe4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Make QQuickEventPoint::grabber a QPointer internallyFrederik Gladhorn2016-07-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Accessing the grabbers was always dangerous. The present code only works because it iterates over all current QQuickItems and doesn't even try to deal with things being deleted inbetween. Change-Id: Id85791dcbd87ec8c5027f9c1376cb39e5779cabe Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Add QQuickPointerEvent::isPressEventFrederik Gladhorn2016-07-291-0/+12
| | | | | | | | | | | | | | | Change-Id: Ied358da23baabfad7e1f75e48a459f1bd5425102 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Touch handling: remove acceptedNewPointsFrederik Gladhorn2016-07-261-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | We keep track of the state inside the individual points, simplify the code. Change-Id: I6716f3ad9bc21ab066888a3b373719c5e4f30af2 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Let clear grabbers remove grab from all pointsFrederik Gladhorn2016-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | There is no harm in clearing the cached points. Even though re-adding points from the cache is also resetting the grab to nullptr. Change-Id: Ia2e0b47199eaee0819bc6baba69bf0436dd2a768 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Add QQuickPointerEvent::unacceptedPressedPointScenePositionsFrederik Gladhorn2016-07-261-0/+10
| | | | | | | | | | | | | | | Change-Id: Iecbd4e35faf733c6be84f760d4636d772188283c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Add QQuickPointerEvent::unacceptedPointScenePositionsFrederik Gladhorn2016-07-261-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Returns a list of scene points for all points that have not been accepted yet. Change-Id: I218e0c779d236e1b5d7d16fe1537adf454b94035 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Keep track of grabbing inside QQuickEventPointFrederik Gladhorn2016-07-251-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | With this we can get rid of "itemForTouchPointId" which kept track of the individual grabbing of touch points. The new approach allows big cleanups and makes understanding the code easier. Change-Id: I19f7cda1b430e088ada707b2e75d97ca8dbadcc5 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Fix QQuickPointerTouchEvent::grabbers()Frederik Gladhorn2016-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The loop would iterate over cached points that were not part of the event. Change-Id: I16a1f52c1616b7bdc5aec2fce4d7d7593edd0e18 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Add QQuickPointerEvent::grabbersFrederik Gladhorn2016-07-241-0/+20
| | | | | | | | | | | | | | | | | | | | | Returns a list of all items that grabbed a point of the event before. Change-Id: Ifa7e6cc7486c4e1a7446a6bf3d4e62d19983ecf7 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Move mouseGrabberItem into the QQuickPointerEventFrederik Gladhorn2016-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The idea is to manage the "grab" for mouse and touch points inside the pointer event, instead of having awkward extra state in the window. Change-Id: I4011c66c163159b0315bf8e284d8e1c7c460f108 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Use Q_GLOBAL_STATIC instead of static members of QWindowPrivateJan Arve Saether2016-07-231-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the members static in QWindowPrivate only gives the benefit of tidyness, but there's still the problem of initialization order and thread-safety. Q_GLOBAL_STATIC solves those issues for us. Change-Id: I8e1279959d0bb2b16fd720cb7f4e9afb6eda6355 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Improve encapsuation of touch/mouse event specific thingsFrederik Gladhorn2016-07-211-20/+10
| | | | | | | | | | | | | | | | | | | | | This makes it easy to avoid casts when using the classes. Change-Id: I27bd1244bffb3a7d2cdb4572c229333e4c499d9b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Hierarchy for touch and mouse pointer eventsFrederik Gladhorn2016-07-211-82/+47
| | | | | | | | | | | | | | | Change-Id: Ie84e39918d9657b29df697be7b0e5198298c48ba Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | add QDebug operators for QQuickPointerEvent, Point and DeviceShawn Rutledge2016-07-191-0/+51
| | | | | | | | | | | | | | | Change-Id: I25c521856cd6d73daeddacb4ae998e4de9109448 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QQuickEventPoint: be a QObject-child of QQuickPointerEventShawn Rutledge2016-07-191-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The points are conceptually children, so this will help take care of memory management. It's also useful to be able to emit or pass a QQuickEventPoint without losing the context of the event it came from. To this end, a pointerEvent() accessor is added, which simply does the static_cast for you. Change-Id: I71e57655cf1a0e7d741c4099c7eb9fc3a9a76446 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Be consistent about constFrederik Gladhorn2016-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The functions should be const, but the returned point not. This allows accepting the points. Change-Id: Iedbe8f3be38d672b33eea352f959b6e2bb6bc4fc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Add QQuickPointerEvent::allPointsAcceptedFrederik Gladhorn2016-07-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Convenience method to decide if the event is completely accepted or further delivery makes sense. Change-Id: I389a975cca2966962848203f69ec7f2e307a210a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QQuickWindow: keep a collection of devices which own event instancesShawn Rutledge2016-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That will allow the event instances to hold state, even between events. So now every QQuickWindow has its own set of them, per device. Hopefully that means we won't have any trouble delivering events in parallel in case each window has its own thread. Otherwise maybe it's slightly wasteful in multi-window apps. Change-Id: I766b580e1c177255905cc04b5de7d33ae503c6fd Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QQuickEventPoint: keep the timestamps, remember when pressedShawn Rutledge2016-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | | Some handlers will care for how long the point has been held so far. Change-Id: I390d92988619054918fcdecd4b092ca9b4cfdea0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Add QQuickEventPoint *QQuickPointerEvent::pointById(int)Shawn Rutledge2016-07-151-0/+22
| | | | | | | | | | | | | | | Change-Id: Id6a41545036b7fe37d5b486789f77642a4241d9a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Add QQuickPointerEvent::syntheticMouseEventFrederik Gladhorn2016-07-151-0/+47
| | | | | | | | | | | | | | | | | | | | | It makes it easier to send synthetic mouse events for touch. Change-Id: Ibb8e2737e3245ae7438708aa170ec1f888e770d8 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QQuickPointerEvent::touchPointById: check iterator against constEndShawn Rutledge2016-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | for consistency with how we started it... Change-Id: I73669a263a1e9c2a77dd0bb217f5163ed0fc2561 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QQuickPointerEvent::touchPointById: capture pointId by valueShawn Rutledge2016-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | It's a scalar, so capturing by reference is inefficient. Change-Id: Ieb6ba8f0ebeb630063e044a27363b2af50ab01ac Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>