summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyleanimation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qstyleanimation.cpp')
-rw-r--r--src/widgets/styles/qstyleanimation.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/widgets/styles/qstyleanimation.cpp b/src/widgets/styles/qstyleanimation.cpp
index 4fb67d90c0..90fb371982 100644
--- a/src/widgets/styles/qstyleanimation.cpp
+++ b/src/widgets/styles/qstyleanimation.cpp
@@ -93,7 +93,10 @@ void QStyleAnimation::setStartTime(const QTime &time)
void QStyleAnimation::updateTarget()
{
QEvent event(QEvent::StyleAnimationUpdate);
+ event.setAccepted(false);
QCoreApplication::sendEvent(target(), &event);
+ if (!event.isAccepted())
+ stop();
}
bool QStyleAnimation::isUpdateNeeded() const
@@ -103,16 +106,8 @@ bool QStyleAnimation::isUpdateNeeded() const
void QStyleAnimation::updateCurrentTime(int)
{
- if (QObject *tgt = target()) {
- if (tgt->isWidgetType()) {
- QWidget *widget = static_cast<QWidget *>(tgt);
- if (!widget->isVisible() || widget->window()->isMinimized())
- stop();
- }
-
- if (isUpdateNeeded())
- updateTarget();
- }
+ if (target() && isUpdateNeeded())
+ updateTarget();
}
QProgressStyleAnimation::QProgressStyleAnimation(int speed, QObject *target) :