From ac54abfb07579c747612c0d9e53089fe5cd32caf Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 2 Dec 2013 22:23:11 +0100 Subject: Fix style animations to stop when the animation target is hidden QStyleAnimation automatically stopped for hidden QWidgets, but didn't know anything about QQuickItems and kept animating regardless of their visibility. This change ensures that style animations stop as soon as the animation target no longer accepts the animation update eg. it has become hidden or the window was minimized. Task-number: QTBUG-35319 Change-Id: Ie48191fd918c626c0d9afe2e7d2390c495efb071 Reviewed-by: Gunnar Sletta --- src/widgets/graphicsview/qgraphicswidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/widgets/graphicsview/qgraphicswidget.cpp') diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index 4abb5e39e5..ccc51120a9 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -1409,9 +1409,14 @@ bool QGraphicsWidget::event(QEvent *event) break; case QEvent::WindowActivate: case QEvent::WindowDeactivate: - case QEvent::StyleAnimationUpdate: update(); break; + case QEvent::StyleAnimationUpdate: + if (isVisible()) { + event->accept(); + update(); + } + break; // Taken from QWidget::event case QEvent::ActivationChange: case QEvent::EnabledChange: -- cgit v1.2.3