aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-03-09 09:05:28 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-03-09 13:50:57 +0000
commit018a76816789adf839f238957cddee13ef7de2e8 (patch)
tree194791f4d3df15c86ffa48b98e9ec27133648c86 /src/quick/items/qquickevents.cpp
parent3b3c8103496f61ebc4b72e73035a4d43fcdd03b0 (diff)
QQuickPointerTouchEvent::reset: detect the type of exclusive grabber
Correction to 3b3c8103496f61ebc4b72e73035a4d43fcdd03b0: never set m_exclusiveGrabber without setting m_grabberIsHandler at the same time, otherwise a crash is possible when static_casting to the wrong type and attempting to call methods on the item or handler. Change-Id: I74e015b4fa2edb68cbd5c45bc3aaa6083eec7784 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents.cpp')
-rw-r--r--src/quick/items/qquickevents.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index 61d843210e..2671b9c9a2 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -949,6 +949,7 @@ QQuickPointerEvent *QQuickPointerTouchEvent::reset(QEvent *event)
} else {
// Restore the grabbers without notifying (don't call onGrabChanged)
point->m_exclusiveGrabber = grabbers.at(i);
+ point->m_grabberIsHandler = (qmlobject_cast<QQuickPointerHandler *>(point->m_exclusiveGrabber) != nullptr);
point->m_passiveGrabbers = passiveGrabberses.at(i);
}
}