| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
One reason is that if event->pointById(someKnownId) returns true,
a handler may assume that the point is still valid. So either
pointById needs to check the valid flag, or we must reset the
pointId so that it won't be found.
Change-Id: I20e93f058737a77ed801f0148ab7525ab880902d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
During delivery we need to call
QQuickItem::mapFromScene(point->scenePos())
so let's do it as early as possible and store the result right in the
EventPoint. That way the pos() property can be made available,
for the benefit of QML/JS signal handlers and also for C++ handlers.
Change-Id: I2706ffd6bc51a449eeba64f69c9ffdfb913c5ca6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some handlers need to track total movement of the points from the time
that the gesture begins. So far it seems that will always be the same
as the moment that the handler decides to grab; so it's enough to
store a copy of the current position when the grab occurs.
Also change setGrabber to call either setItemGrabber
or setPointerHandlerGrabber so that we only need to add
new features like this one in two places instead of three.
Change-Id: Ia944bf27302fc305a21957e8b02174909c024a90
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| | |
It's important for some handlers to track the total movement so far.
Change-Id: If729c48731725aa035c32d203d719ea80df83078
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
|
| |
| |
| |
| |
| | |
Change-Id: Ife4dff906e17f92bcbfa2003ceb9f77e42cbb6ff
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| | |
QQuickPointerHandler and QQuickItem have only QObject in common.
Change-Id: I8fb68cc1779f42049db1e0eb5ff60019a1c674d3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
|
| |
| |
| |
| |
| | |
Change-Id: Ifc3fc767546fc8d18ebaba0a07a1143239c2e194
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
|
|/
|
|
|
|
|
|
|
| |
Since its used in a Q_GLOBAL_STATIC which requires its type to have
a public ctor, we have to delegate the ctor to a subclass (named
ConstructableQQuickPointerDevice).
Change-Id: I51932f16254f6ec6e512c78b280b307d6e0a300e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: I35bd1aa524705c8c6541428b2737b992de2ad05d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I604fe1470bfab831e31d129d3b734213273fc333
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
| |
The mouse pointer event doesn't need it.
Change-Id: I68999f79a0d979cf414b11a2e6b4863df1a1e817
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I5f58f53a10b11906c1f784f1cab96ec761d8d588
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: Ib2c99d25e5922c5146b82d1e00c9e97b621eaa81
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Id8709b45af135df5f16558c4b611409bc134ea63
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Makes it possible to assign QQuickPointerDevice from the PointerEvent.
Change-Id: Ica5182175eea210f5fe090807ed54467be11b031
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes deliverMouseEvent() slightly more generic: the only place
we now care about it being a mouse event is to be able to call
sendEvent() with the original event.
Change-Id: Ibd1660bb45b6f8b3a5b9926aeb3dc85ff2e41d0f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Reduce allocations of events, just refill the local pos.
Change-Id: I2948faf0e302bff315e482f2c1432fe0def19bc5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: Ied358da23baabfad7e1f75e48a459f1bd5425102
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We keep track of the state inside the individual points, simplify the
code.
Change-Id: I6716f3ad9bc21ab066888a3b373719c5e4f30af2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Iecbd4e35faf733c6be84f760d4636d772188283c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: Id9d602a4312db3877e21e449fcd2bbb3b58e1ced
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
This makes it easy to avoid casts when using the classes.
Change-Id: I27bd1244bffb3a7d2cdb4572c229333e4c499d9b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ie84e39918d9657b29df697be7b0e5198298c48ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I58af7a1603bca3a17713e4cb674ae004e2d6eda9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I25c521856cd6d73daeddacb4ae998e4de9109448
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| | |
Change-Id: I931a7b264c68c40e16d9467b48173311aef74bd0
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
In a following patch, the device will own the event instance by value,
so it needs to be defined first.
Change-Id: Id1520257115889198c3e9ff20c56028c0b6d4bd2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: Id6a41545036b7fe37d5b486789f77642a4241d9a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
It makes it easier to send synthetic mouse events for touch.
Change-Id: Ibb8e2737e3245ae7438708aa170ec1f888e770d8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The first few values in QQuickPointerDevice::CapabilityFlag must be
kept in sync with QTouchDevice::CapabilityFlag, so make it explicit.
Change-Id: I0c1147319e057df26a8a732a4e494b762a1f5301
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I104edaabc35a073e14e8c66cd268ecd3782ed361
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In 649b309ea9ed7d03aa74565d51edb416c23460d9 it was correct that the
pool did not need to be static, because the whole event is a singleton;
but it allowed the actual m_touchPoints vector to keep growing,
rather than resizing to the current number of points. When one finger
is pressed, then two, then one is released, pointCount must go from
1 -> 2 -> 1. And yet we'd like to avoid heap-allocating a fresh
QQuickEventTouchPoint object every time a touchpoint is pressed. The
choices are then to 1) exploit implementation details of QVector to
allow its count() to be different than its stored size but still
guarantee that every pointer it stores points to a long-lived
QQuickEventTouchPoint (the docs do say "Since Qt 5.6, resize() doesn't
shrink the capacity anymore"), which is what we thought we were doing;
2) store the pointCount in a separate variable, so that the prefix of
m_touchPoints are the valid ones while the remainder is the "pool", or
3) hold a separate reusable pool of touchpoints. The separate
m_pointCount is cheaper than the pool, so let's go with option 2.
Change-Id: Ic59b5393e9f4b05e4ec27db15d6f06253aa820d5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Maybe if (isTouchEvent()) is more efficient than if (asTouchEvent()).
Change-Id: Ie3e216ff5c9b512abc4a25690f98cb948e8b5399
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It's not enough on Windows: it gets sign-extended, so 0x08 becomes -8
as an int, in comparisons. The result was that touchpoints were never
released.
Anyway we hardly have to worry about this now that we're not copying
the event points.
Change-Id: I0d47a0974a9cf5bc9a090a15948d112df32403eb
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It's similar to QQuickWindowPrivate::touchEventWithPoints(), and is
used in the same way when delivering a QQuickPointerEvent by sending
a QTouchEvent to the item's event() method.
Change-Id: I0d181eaf924bfdad2db2de9d8acf85d0345aec3e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|