aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Never create pointer events from mouseGrabberItem()Jan Arve Saether2017-11-071-0/+1
| | | | | | | | | | | | | | | Normally, this was not a problem, but it is problematic during QQuickWindow destruction: The list of pointer event instances are destroyed, but later the grabber is removed (through call to removeGrabber()). This queries the mouseGrabberItem(), which would create a new pointer event instance. It also has the benefit that d->pointerEventInstances are now only populated due to actual incoming events. Task-number: QTBUG-61434 Change-Id: I4e7b6f5643f3b971138a1f7c7237ee734d29783c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Move pointerEvent instance to QQuickWindowJan Arve Saether2017-05-101-0/+4
| | | | | | | | | | | | With two or more windows, if events are being delivered to each, the grabbers can be different in each. We need unique instances of the QQuickPointerEvent objects for each window to avoid losing the grab state in the parent window while delivering a synthesized event to a subwindow, for example. Change-Id: I51da1212d573853969e32ad78f5b219d979a8a5c Task-number: QTBUG-57253 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-7/+21
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * QQuickWindowPrivate::dragOverThreshold(): ignore zero velocity thresholdJan Arve Saether2016-12-071-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, this would trigger a drag even if the touch point was quite steady, since a rather steady finger could report a very small velocity (usually between 0 and 1). Change so that it will ignore velocity if it's not positive. At the same time convert it to a template function since we want to also use this for QQuickEventPoint later on. Change-Id: Ibb2210813707399ae84e3422718c995897891060 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-6/+6
| | | | | | | | | | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Quick: add missing 'override'Anton Kudryavtsev2016-10-121-1/+1
| | | | | | | | | | | | | | ... and drop redundant 'virtual' Change-Id: Iffebc971122f39212ea091ed1fe39e3a1fd68469 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Quick: mark some methods as constAnton Kudryavtsev2016-10-121-1/+1
|/ | | | | | | These methods do not modify objects. Change-Id: Ibb2622cad6fbcec31c785f5d032304c648372350 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Pass pointerEvent into QQuickWindowPrivate::deliverTouchAsMouseFrederik Gladhorn2016-08-041-1/+1
| | | | | Change-Id: I53c737498f27db3e1fea4fd2f9e10f75a2b48d14 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge branch 'dev' into wip/pointerhandlerFrederik Gladhorn2016-08-041-3/+3
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickwindow.cpp: we need the fix for QTBUG-31861 but now using QQuickPointerMouseEvent src/quick/items/qquickwindow_p.h: hover events need timestamps (e4f7ab42) tests/auto/quick/qquickwindow/tst_qquickwindow.cpp: added test for QTBUG-31861 Change-Id: Ic120513b69b318df3ba62d8174c276cbf6b7b55e
| * Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-021-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickshadereffect.cpp 5.7 had a bug-fix in code dev has replaced wholesale. src/quick/items/qquickwindow.cpp src/quick/items/qquickwindow_p.h One side changed a method's signature; the other side renamed a method declared adjacent to it and changed some code using it, moving some from the public class to its private partner. tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp One side added a blank line before a comment the other re-wrote. Kept the re-write, killed the stray blank. .qmake.conf Ignore 5.7's change to MODULE_VERSION. src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qqmlpropertyvalidator.cpp 5.7 changed code in the former that dev moved to the latter. Reflect 5.7's changes there, adapted to dev's form. src/qml/qml/qqmlobjectcreator.cpp One side added new QVariant types; the other changed how it handled each type of QVariant (without git seeing any conflict); adapted the new stanzas to work the same as the transformed ones. tests/manual/v4/test262 dev had a broken sha1 for it; so used 5.7's 9741ac4655808ac46c127e3d1d8ba3d27ada618e Change-Id: I1fbe2255b97d6ef405cdd1d0cea7fab8dc351d6f
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-151-3/+3
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/demos/photoviewer/deployment.pri One side made it redundant; the other removed part of it; remove it all ! src/quick/scenegraph/util/qsgatlastexture.cpp One side changed a preprocessor condition, the other a code condition, on adjacent lines; keep both changes. tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp One side changed a condition, the other the content of its block; keep both. Change-Id: Idb8937f92a7edb28212449dfe0c5cfdb8e6de986
| | | * QQuickWindow: Fill out timestamps in QHoverEvents sent to QQuickItemsDaniel d'Andrada2016-07-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-54600 Change-Id: Ie24c44e2f68aae55ff1146c13c3dfc25349b7a29 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Remove touchMouseIdCandidatesFrederik Gladhorn2016-08-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The set was there to protect from assigning to touchMouseId twice. That seems rather redundant: either something can become the touchMouseId, because touchMouseId is -1, or well, it can't. I suspect this set was needed before, when pre-grabbing was still there. Change-Id: I56d2c86cd13a3f6ec129d27ff8d5f7edf35df7cb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Pass pointer event into sendFilteredTouchEventFrederik Gladhorn2016-08-031-4/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Id8709b45af135df5f16558c4b611409bc134ea63 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Start to unite press event delivery for touch and mouseFrederik Gladhorn2016-08-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Needs some cleanup, but seems to work now. Change-Id: I579009648d874c9293a0ebb3d7809536420b5574 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Stop copying mouse events when delivering themFrederik Gladhorn2016-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce allocations of events, just refill the local pos. Change-Id: I2948faf0e302bff315e482f2c1432fe0def19bc5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Rename translateTouchToMouse -> deliverTouchAsMouseFrederik Gladhorn2016-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function actually sends the event, not just "translates". Change-Id: Ia9b4d136f8f6c214f52beacf89cdf686e4617570 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Deliver touch points in defined orderFrederik Gladhorn2016-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick] Touch events are now delivered in a well defined order: New touch points are delivered first to items under the finger which was first touching the screen. Then to items that are under the second finger and finally to common ancestors. This means that items that are "on top" will get a chance to grab touch points before any items in the background. Change-Id: Icf9a163c0183437cdb79040b8513fd746c3a6a44 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Add mergePointerTargets to create pointer delivery listFrederik Gladhorn2016-08-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code joins lists of "target item" which are joins of where several touch points should be delivered. Change-Id: I15ab4b7f70b8930d15368bf4cba0893ab339fa2a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Pass PointerEvent into deliverMouseEventFrederik Gladhorn2016-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ib9e1748cea24851ecc369da5d658654341d291ac Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Touch event delivery: split into press and update deliveryFrederik Gladhorn2016-07-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of iterating through all possible receivers when touch events get delivered, the event gets sent directly to the right item. Change-Id: I341bbdc095744a99c6c4011f07d5f5a239b7fe46 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Remove return value that is always ignoredFrederik Gladhorn2016-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I26ffdebf594422588febc4a031a88fa5e8e3f970 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Remove unused parameterFrederik Gladhorn2016-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was only called in one place, no need to have an extra parameter if it's always going to have the same value. Change-Id: I29ed6ca1b7cc3722d11fb3f42ffc640e48c18af8 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Touch cleanupFrederik Gladhorn2016-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of all the lists and sets that were passed around before. Change-Id: I75371742a598ba658c3d0b0aea30e3f8a60f9203 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Touch handling: Remove acceptedNewPointsFrederik Gladhorn2016-07-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state is moved into the points, continue cleanup of no longer needed hard to understand code. Change-Id: I1f63f3ac844ac240bc8595bdc936778800726863 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Keep track of the device which was grabbed as mouse for touchFrederik Gladhorn2016-07-271-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I695e2b4663abea5d227b8d8d9dff8a2342238db9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Touch handling: remove acceptedNewPointsFrederik Gladhorn2016-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We keep track of the state inside the individual points, simplify the code. Change-Id: I6716f3ad9bc21ab066888a3b373719c5e4f30af2 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Minor cleanup: pass through pointerTouchEventFrederik Gladhorn2016-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I78d6576e43480e9c63f2c2983be662c290acb922 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Pass QQuickPointerTouchEvent to deliverTouchEventFrederik Gladhorn2016-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We cast inside the function anyway, start cleaning it up. Change-Id: I9687919a87c6cb4b6bd0d68471e76df8d1027b97 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Keep track of grabbing inside QQuickEventPointFrederik Gladhorn2016-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Move mouseGrabberItem into the QQuickPointerEventFrederik Gladhorn2016-07-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Remove unused variableFrederik Gladhorn2016-07-211-4/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: Ibfac6509696ad62da8741d3ccb938ecdcc94ecd3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Merge "Merge remote-tracking branch 'origin/dev' into HEAD" into ↵Shawn Rutledge2016-07-191-18/+1
|\ \ \ \ | | | | | | | | | | | | | | | refs/staging/wip/pointerhandler
| * | | | Merge remote-tracking branch 'origin/dev' into HEADFrederik Gladhorn2016-07-181-18/+1
| |\| | | | | | | | | | | | | | | | | | Change-Id: I931a7b264c68c40e16d9467b48173311aef74bd0
| | * | | move QQuickCloseEvent from qquickwindow_p.h to qquickevents_p_p.hShawn Rutledge2016-07-151-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems to be the same sort of persistent event for exposure to QML. Change-Id: I4ebc48422ee517f37e300629b6d100f68b9703b3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * | | Move implementation of grabTouchPoints to QQuickWindowPrivateShawn Rutledge2016-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickItem should not be directly manipulating QQuickWindowPrivate's variables. Change-Id: I5ff11550351398247dacf14447fb6c897b2dd0aa Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | | QQuickWindowPrivate::deliverPoints: take QQuickPointerEvent non-constShawn Rutledge2016-07-181-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | The event should be accepted or rejected. Change-Id: I5d9b222913763d45cfb47ff8fe6ea4426563bc21 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | QQuickWindow: keep a collection of devices which own event instancesShawn Rutledge2016-07-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Add pointerTargets to determine list of items at a positionFrederik Gladhorn2016-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: If4e040063f0141ef745a4ee335cdec0640a73c64 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Re-factor deliverInitialMousePressFrederik Gladhorn2016-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use pointerTargets to get a list of relevant QQuickItems, try delivering the event to them. Change-Id: Ib45f05ce84181c9a0c092dbc255f75e5f1f220af Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | qquickwindow_p.h: group and sort the forward declarationsShawn Rutledge2016-07-131-14/+10
| | | | | | | | | | | | | | | | | | | | Change-Id: I3e260b592174254ce7b2fdc1b7c205cbca0babd1 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Sort pointer event delivery functionsFrederik Gladhorn2016-07-131-6/+13
| | | | | | | | | | | | | | | | | | | | Change-Id: Ib21a2c4f762a53f2f1d386a40380a68a5383dbe3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | deliver touch events as QQuickPointerEventsShawn Rutledge2016-07-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickPointerEvent::touchEventForItem should replace QQuickWindow::touchEventWithPoints, but the latter is still called from one place. This can be fixed when we redo parent-filtering using a presorted delivery list. Change-Id: I350a912a9801294d4f44d3d56b53fe3be5302a60 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Move delivery of pointer event into deliverTouchEventFrederik Gladhorn2016-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ie014105668e6cbba60203af988948249e2e0228c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Generalize the touchRecursionGuard to pointer eventsFrederik Gladhorn2016-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we want to do mouse event compression, this makes sense. It's also a small step towards more unified event delivery. Change-Id: Ia889e21ce2834ef4fa26b4c5906cbce04850bf38 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | PointerEvents: start unified delivery code pathFrederik Gladhorn2016-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This really does nothing but join all incoming events, package them into pointer events and then unpack them to send them on their separate ways again. Change-Id: Iad87b86051963c064d7a41d9a64b4551efe1f039 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Simplify parameters to QQuickPointerEvent::resetFrederik Gladhorn2016-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need the device passed in, but can infer it. Change-Id: I95479493431f8ca8047bcf124c295081d4895d6c Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | QQuickWindow: add QQuickPointerDevice instances for pointer eventsShawn Rutledge2016-07-071-0/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | The device objects are long-lived; every QQuickPointerEvent needs a pointer to one of them. Change-Id: I39e4b8ddefd4a62521c7837c4bafb84ee13ce519 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Move touch event compression into a functionFrederik Gladhorn2016-07-061-0/+1
| | | | | | | | | | | | | | | | | | | | | This makes it easier to understand what's going on. Change-Id: I7846178d791b12fc3b78a5790419fe7fb32601f2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>