aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents_p_p.h
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@qt.io>2017-05-22 15:34:18 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2017-05-26 10:59:37 +0000
commit0e3adb65b0e9c44fa6e202630ff57c907ecf0820 (patch)
tree1169b78f859b7702b246d4c08f30c935dbeb9550 /src/quick/items/qquickevents_p_p.h
parentb10e30705400a7967fd8c4215f201ce9586d9ecc (diff)
Fix some problems with MouseDblClick handling
The sequence of events delivered from a double click is: [Press,Release,Press,DblClick,Release] The problem was that a DblClick was delivered just like a press event, so it would clear the passive grabber that was established because of the former Press event. When the Release event then got processed, there was therefore a risk that the Release event was not delivered to the passive grabber. The fix is to not deliver DblClick events at all to handlers, and to not deliver DblClick to items if the former Press event was accepted by a handler. Change-Id: I49c0e32ef4e33f7b6014d35dc065da2527b94779 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents_p_p.h')
-rw-r--r--src/quick/items/qquickevents_p_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h
index 9ab6ea9955..19b2a6221e 100644
--- a/src/quick/items/qquickevents_p_p.h
+++ b/src/quick/items/qquickevents_p_p.h
@@ -407,6 +407,7 @@ public: // helpers for C++ only (during event delivery)
virtual void localize(QQuickItem *target) = 0;
virtual bool isPressEvent() const = 0;
+ virtual bool isDoubleClickEvent() const { return false; }
virtual bool isUpdateEvent() const = 0;
virtual bool isReleaseEvent() const = 0;
virtual QQuickPointerMouseEvent *asPointerMouseEvent() { return nullptr; }
@@ -451,6 +452,7 @@ public:
QQuickPointerEvent *reset(QEvent *) override;
void localize(QQuickItem *target) override;
bool isPressEvent() const override;
+ bool isDoubleClickEvent() const override;
bool isUpdateEvent() const override;
bool isReleaseEvent() const override;
QQuickPointerMouseEvent *asPointerMouseEvent() override { return this; }