@@ -19,6 +19,7 @@
19#include <QQmlEngine>
19#include <QQmlEngine>
20#include <QQuickView>
20#include <QQuickView>
21#include <QSharedPointer>
21#include <QSharedPointer>
22+#include <private/qquickanimatorcontroller_p.h>
22#include <private/qquickwindow_p.h>
23#include <private/qquickwindow_p.h>
24// C++ std lib
25// C++ std lib
@@ -191,7 +192,15 @@ void tst_TouchGate::holdsEventsUntilGainsOwnership()
191 if (!ownershipAfterTouchEnd) {
192 if (!ownershipAfterTouchEnd) {
192 touchRegistry->removeCandidateOwnerForTouch(0, candidateItem);
193 touchRegistry->removeCandidateOwnerForTouch(0, candidateItem);
193 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(testItem->window());
194 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(testItem->window());
194− wp->flushDelayedTouchEvent();
195+ if (wp->delayedTouch) {
196+ wp->deliverDelayedTouchEvent();
198+ // Touch events which constantly start animations (such as a behavior tracking
199+ // the mouse point) need animations to start.
200+ QQmlAnimationTimer *ut = QQmlAnimationTimer::instance();
201+ if (ut && ut->hasStartAnimationPending())
202+ ut->startAnimations();
195 // TouchGate should now open its flood gates and let testItem get all
204 // TouchGate should now open its flood gates and let testItem get all
196 // events from touch 0 produced so far
205 // events from touch 0 produced so far
197 QCOMPARE(testItem->touchEventsReceived.count(), 2);
206 QCOMPARE(testItem->touchEventsReceived.count(), 2);