From 3b7a8d9d5e214a88f5855800e7bf54da4425d7b9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 2 Dec 2013 22:44:21 +0100 Subject: Fix style animations to stop when the item is hidden QStyleAnimation automatically stopped for hidden QWidgets, but didn't know anything about QQuickItems and kept animating regardless of their visibility. QStyleAnimation was changed so that it will keep animating only as long as the animation target accepts animation updates. This change ensures that the style animation updates are accepted only when the item is visible. Task-number: QTBUG-35319 Change-Id: I3c93a653316b8abbbc32940cd7499b660828eff8 Reviewed-by: Gunnar Sletta Reviewed-by: Jens Bache-Wiig --- src/quick/items/qquickitem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index c11bf904be..a0329f7afc 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -7012,7 +7012,10 @@ bool QQuickItem::event(QEvent *ev) } else #endif // QT_NO_IM if (ev->type() == QEvent::StyleAnimationUpdate) { - update(); + if (isVisible()) { + ev->accept(); + update(); + } return true; } return QObject::event(ev); -- cgit v1.2.3