@@ -19,6 +19,7 @@
1919#include <QQmlEngine>
2020#include <QQuickView>
2121#include <QSharedPointer>
22+#include <private/qquickanimatorcontroller_p.h>
2223#include <private/qquickwindow_p.h>
2324
2425// C++ std lib
@@ -191,7 +192,15 @@ void tst_TouchGate::holdsEventsUntilGainsOwnership()
191192 if (!ownershipAfterTouchEnd) {
192193 touchRegistry->removeCandidateOwnerForTouch(0, candidateItem);
193194 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(testItem->window());
194− wp->flushDelayedTouchEvent();
195+ if (wp->delayedTouch) {
196+ wp->deliverDelayedTouchEvent();
197+
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();
203+ }
195204 // TouchGate should now open its flood gates and let testItem get all
196205 // events from touch 0 produced so far
197206 QCOMPARE(testItem->touchEventsReceived.count(), 2);