aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@theqtcompany.com>2015-02-19 07:52:35 +0100
committerShawn Rutledge <shawn.rutledge@theqtcompany.com>2016-03-07 14:23:22 +0000
commit2f85907193ad934d911fe97f7000ecb0662de8cb (patch)
tree84237b757fa97fc8060b86c4d60ad98a425ad492 /src/quick/items/qquickwindow_p.h
parent3b7e2a69f7eb8597c807de39b4de39721e9e2bd2 (diff)
QQuickWindow: prerequisites for handling multi-point touch
In touchEventForItem, we want to include only touchpoints that occur inside the target item if the touchpoint is freshly pressed; but if the touchpoint is being updated or released, in most cases we want to keep sending it to the same item, because the item must be able to change state. But in sendFilteredTouchEvent, we need to check the bounds of all touchpoints. Making touchEventForItem and touchEventWithPoints static also avoids needing to get the QQuickWindowPrivate instance, since these functions do not use any private data. And we will need a version of dragOverThreshold which works with TouchPoints since it doesn't share a common ancestor class with QMouseEvent. Change-Id: I022c6bcf36382741b31baeb020d3104d502a11e8 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickwindow_p.h')
-rw-r--r--src/quick/items/qquickwindow_p.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index 1064be7178..1486e20e1e 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -163,8 +163,8 @@ public:
void flushDelayedTouchEvent();
bool deliverHoverEvent(QQuickItem *, const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, bool &accepted);
bool deliverMatchingPointsToItem(QQuickItem *item, QTouchEvent *event, QSet<int> *acceptedNewPoints, const QSet<int> &matchingNewPoints, const QList<QTouchEvent::TouchPoint> &matchingPoints, QSet<QQuickItem*> *filtered);
- QTouchEvent *touchEventForItemBounds(QQuickItem *target, const QTouchEvent &originalEvent);
- QTouchEvent *touchEventWithPoints(const QTouchEvent &event, const QList<QTouchEvent::TouchPoint> &newPoints);
+ static QTouchEvent *touchEventForItem(QQuickItem *target, const QTouchEvent &originalEvent, bool alwaysCheckBounds = false);
+ static QTouchEvent *touchEventWithPoints(const QTouchEvent &event, const QList<QTouchEvent::TouchPoint> &newPoints);
bool sendFilteredTouchEvent(QQuickItem *target, QQuickItem *item, QTouchEvent *event, QSet<QQuickItem*> *filtered);
bool sendHoverEvent(QEvent::Type, QQuickItem *, const QPointF &scenePos, const QPointF &lastScenePos,
Qt::KeyboardModifiers modifiers, bool accepted);
@@ -265,6 +265,7 @@ public:
static bool defaultAlphaBuffer;
static bool dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent *event, int startDragThreshold = -1);
+ static bool dragOverThreshold(qreal d, Qt::Axis axis, const QTouchEvent::TouchPoint *tp, int startDragThreshold = -1);
// data property
static void data_append(QQmlListProperty<QObject> *, QObject *);