aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickflickable_p_p.h
diff options
context:
space:
mode:
authorMatt Vogt <matthew.vogt@jollamobile.com>2012-11-29 08:35:00 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-29 06:39:10 +0100
commitd02131e743597b9bd3070d986c61a1c91ea8317a (patch)
tree03f747e256d3c9d86891786aadee79673a509dbe /src/quick/items/qquickflickable_p_p.h
parentb68d7ab0a52ea9e94a3e62767357e0c735727969 (diff)
Fix mouse event distribution for Flickable with pressDelay
If an item responds to mouse events but does not accept them, it can prevent the events from being processed by the correct item further up the parent chain. For example, a text item inside a mouse area can wrongly consume a press event, so that the following release event does not yield a click when processed by the mouse area. Rather than speculatively assigning the mouse grab to items during event filter processing, change Flickable to retain the grab for the duration of the pressDelay and to release it during replay of the press event. Change-Id: Ied12b9643838a984c7026978047465c2830e55e4 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Diffstat (limited to 'src/quick/items/qquickflickable_p_p.h')
-rw-r--r--src/quick/items/qquickflickable_p_p.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h
index ac1ecdb3cb..1aa4c4ab3e 100644
--- a/src/quick/items/qquickflickable_p_p.h
+++ b/src/quick/items/qquickflickable_p_p.h
@@ -183,9 +183,10 @@ public:
void updateBeginningEnd();
- bool isOutermostPressDelay() const;
- void captureDelayedPress(QMouseEvent *event);
+ bool isInnermostPressDelay(QQuickItem *item) const;
+ void captureDelayedPress(QQuickItem *item, QMouseEvent *event);
void clearDelayedPress();
+ void replayDelayedPress();
void setViewportX(qreal x);
void setViewportY(qreal y);
@@ -213,6 +214,7 @@ public:
bool interactive : 1;
bool calcVelocity : 1;
bool pixelAligned : 1;
+ bool replayingPressEvent : 1;
QElapsedTimer timer;
qint64 lastPosTime;
qint64 lastPressTime;
@@ -222,7 +224,6 @@ public:
qreal maxVelocity;
qreal reportedVelocitySmoothing;
QMouseEvent *delayedPressEvent;
- QQuickItem *delayedPressTarget;
QBasicTimer delayedPressTimer;
int pressDelay;
int fixupDuration;