diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 2cb3fe86e1..70f4cc4267 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -226,10 +226,16 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { - Q_UNUSED(touches) // ### can a subset of the active touches be cancelled? + if (!touches) { + m_activeTouches.clear(); + } else { + for (UITouch *touch in touches) + m_activeTouches.remove(touch); + + Q_ASSERT_X(m_activeTouches.isEmpty(), Q_FUNC_INFO, + "Subset of active touches cancelled by UIKit"); + } - // Clear current touch points - m_activeTouches.clear(); m_nextTouchId = 0; // Send cancel touch event synchronously