diff options
Diffstat (limited to 'src/widgets/widgets/qwidgetanimator.cpp')
| -rw-r--r-- | src/widgets/widgets/qwidgetanimator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/widgets/qwidgetanimator.cpp b/src/widgets/widgets/qwidgetanimator.cpp index 99a051357ee..1216f535b8b 100644 --- a/src/widgets/widgets/qwidgetanimator.cpp +++ b/src/widgets/widgets/qwidgetanimator.cpp @@ -53,7 +53,7 @@ void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, boo //If the QStyle has animations, animate if (const int animationDuration = widget->style()->styleHint(QStyle::SH_Widget_Animation_Duration, nullptr, widget)) { AnimationMap::const_iterator it = m_animation_map.constFind(widget); - if (it != m_animation_map.constEnd() && (*it)->endValue().toRect() == final_geometry) + if (it != m_animation_map.constEnd() && *it && (*it)->endValue().toRect() == final_geometry) return; QPropertyAnimation *anim = new QPropertyAnimation(widget, "geometry", widget); @@ -76,7 +76,8 @@ void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, boo bool QWidgetAnimator::animating() const { - return !m_animation_map.isEmpty(); + auto isActiveAnimation = [](const QPointer<QPropertyAnimation> &p) { return !p.isNull(); }; + return !std::all_of(m_animation_map.begin(), m_animation_map.end(), isActiveAnimation); } QT_END_NAMESPACE |
