aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-08-24 15:55:33 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2017-08-25 05:47:18 +0000
commit31d90e308e46d644d74e9434ce31dd664677bc59 (patch)
tree23ca0fa488e63cd61acf1dc76565a9c2372fc721
parent4200f7117973969392be48b0c82f1b4bc214e546 (diff)
SwipeDelegate: grab the mouse when accepting a press event
After 1f4bfc099b7e48e2cc3dd9488b7b42a96122b299 in qtdeclarative, QQuickWindow does not cause the Item to which it's about to attempt to deliver an event to pre-grab. (That caused a lot of thrashing of the grabber, so not doing that is a nice simplification, and also avoids the need to ungrab later, and also makes mouse event handling more like touch event handling.) So whenever SwipeDelegate knows at the time of mouse press that it wants to see the release too, it should grab. The grabber can be either the Item for which it's filtering events, or the SwipeDelegate itself, whichever is more appropriate in any given scenario. For now I assume it should be the delivery-target Item, because that's what would have had the grab before. Task-number: QTBUG-62412 Task-number: QTBUG-62631 Change-Id: Ie01276508c6602b10f9d7996a748ffe90efa36b5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/quicktemplates2/qquickswipedelegate.cpp2
-rw-r--r--tests/auto/controls/default/BLACKLIST20
-rw-r--r--tests/auto/controls/fusion/BLACKLIST20
-rw-r--r--tests/auto/controls/imagine/BLACKLIST20
-rw-r--r--tests/auto/controls/material/BLACKLIST20
-rw-r--r--tests/auto/controls/universal/BLACKLIST20
6 files changed, 2 insertions, 100 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp
index 8e0cf3fe..d96e124a 100644
--- a/src/quicktemplates2/qquickswipedelegate.cpp
+++ b/src/quicktemplates2/qquickswipedelegate.cpp
@@ -737,6 +737,7 @@ bool QQuickSwipeDelegatePrivate::handleMousePressEvent(QQuickItem *item, QMouseE
// so we correct it after calling the base class' mousePressEvent(), rather
// than having to duplicate its code just so we can set the pressPoint.
pressPoint = item->mapToItem(q, event->pos());
+ q->grabMouse();
return true;
}
@@ -753,6 +754,7 @@ bool QQuickSwipeDelegatePrivate::handleMousePressEvent(QQuickItem *item, QMouseE
attached->setPressed(true);
// Stop the event from propagating, as QQuickItem explicitly ignores events.
event->accept();
+ item->grabMouse();
return true;
}
diff --git a/tests/auto/controls/default/BLACKLIST b/tests/auto/controls/default/BLACKLIST
deleted file mode 100644
index 92121233..00000000
--- a/tests/auto/controls/default/BLACKLIST
+++ /dev/null
@@ -1,20 +0,0 @@
-# See qtbase/src/testlib/qtestblacklist.cpp for format
-
-# https://bugreports.qt.io/browse/QTBUG-62412
-[SwipeDelegate::test_close]
-*
-
-[SwipeDelegate::test_dragSideAction]
-*
-
-[SwipeDelegate::test_eventsToLeftAndRight]
-*
-
-[SwipeDelegate::test_multipleClickableActions]
-*
-
-[SwipeDelegate::test_removableDelegates]
-*
-
-[SwipeDelegate::test_swipeVelocity]
-*
diff --git a/tests/auto/controls/fusion/BLACKLIST b/tests/auto/controls/fusion/BLACKLIST
deleted file mode 100644
index 92121233..00000000
--- a/tests/auto/controls/fusion/BLACKLIST
+++ /dev/null
@@ -1,20 +0,0 @@
-# See qtbase/src/testlib/qtestblacklist.cpp for format
-
-# https://bugreports.qt.io/browse/QTBUG-62412
-[SwipeDelegate::test_close]
-*
-
-[SwipeDelegate::test_dragSideAction]
-*
-
-[SwipeDelegate::test_eventsToLeftAndRight]
-*
-
-[SwipeDelegate::test_multipleClickableActions]
-*
-
-[SwipeDelegate::test_removableDelegates]
-*
-
-[SwipeDelegate::test_swipeVelocity]
-*
diff --git a/tests/auto/controls/imagine/BLACKLIST b/tests/auto/controls/imagine/BLACKLIST
deleted file mode 100644
index 92121233..00000000
--- a/tests/auto/controls/imagine/BLACKLIST
+++ /dev/null
@@ -1,20 +0,0 @@
-# See qtbase/src/testlib/qtestblacklist.cpp for format
-
-# https://bugreports.qt.io/browse/QTBUG-62412
-[SwipeDelegate::test_close]
-*
-
-[SwipeDelegate::test_dragSideAction]
-*
-
-[SwipeDelegate::test_eventsToLeftAndRight]
-*
-
-[SwipeDelegate::test_multipleClickableActions]
-*
-
-[SwipeDelegate::test_removableDelegates]
-*
-
-[SwipeDelegate::test_swipeVelocity]
-*
diff --git a/tests/auto/controls/material/BLACKLIST b/tests/auto/controls/material/BLACKLIST
deleted file mode 100644
index 92121233..00000000
--- a/tests/auto/controls/material/BLACKLIST
+++ /dev/null
@@ -1,20 +0,0 @@
-# See qtbase/src/testlib/qtestblacklist.cpp for format
-
-# https://bugreports.qt.io/browse/QTBUG-62412
-[SwipeDelegate::test_close]
-*
-
-[SwipeDelegate::test_dragSideAction]
-*
-
-[SwipeDelegate::test_eventsToLeftAndRight]
-*
-
-[SwipeDelegate::test_multipleClickableActions]
-*
-
-[SwipeDelegate::test_removableDelegates]
-*
-
-[SwipeDelegate::test_swipeVelocity]
-*
diff --git a/tests/auto/controls/universal/BLACKLIST b/tests/auto/controls/universal/BLACKLIST
deleted file mode 100644
index 92121233..00000000
--- a/tests/auto/controls/universal/BLACKLIST
+++ /dev/null
@@ -1,20 +0,0 @@
-# See qtbase/src/testlib/qtestblacklist.cpp for format
-
-# https://bugreports.qt.io/browse/QTBUG-62412
-[SwipeDelegate::test_close]
-*
-
-[SwipeDelegate::test_dragSideAction]
-*
-
-[SwipeDelegate::test_eventsToLeftAndRight]
-*
-
-[SwipeDelegate::test_multipleClickableActions]
-*
-
-[SwipeDelegate::test_removableDelegates]
-*
-
-[SwipeDelegate::test_swipeVelocity]
-*