diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2017-11-01 15:49:47 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2017-11-02 13:56:46 +0000 |
commit | 62e23e1ae6542b5ab837a2481d9257c81e484013 (patch) | |
tree | 52689c263b9dfcdaa0beb7c46220997fb019f88e /src/quick/items | |
parent | 5cb76fb3704947cfc4d575695b137460ecc8bbd9 (diff) |
Avoid bogus "cancelGrab: no grabber" warning
Should not alter any behavior except that the warning is gone.
Change-Id: I684532ece7eddaeafd7ff26daa23a1c9968243f3
Task-number: QTBUG-62424
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 45c14f10a1..4210ba36ad 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -762,8 +762,11 @@ void QQuickWindowPrivate::setMouseGrabber(QQuickItem *grabber) auto point = pointerEventInstance(touchMouseDevice)->pointById(touchMouseId); if (point) { auto originalEvent = pointerEventInstance(point->pointerEvent()->device()); - for (int i = 0; i < originalEvent->pointCount(); ++i) - originalEvent->point(i)->cancelExclusiveGrab(); + for (int i = 0; i < originalEvent->pointCount(); ++i) { + QQuickEventPoint *pt = originalEvent->point(i); + if (pt->exclusiveGrabber()) + pt->cancelExclusiveGrab(); + } point->setGrabberItem(grabber); for (auto handler : point->passiveGrabbers()) point->cancelPassiveGrab(handler); |