qwidgetanimator.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qwidgetanimator.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QWidgetAnimator::QWidgetAnimator(QMainWindowLayout *layout) : m_mainWindowLayout(layout)-
6{-
7}
never executed: end of block
0
8-
9void QWidgetAnimator::abort(QWidget *w)-
10{-
11-
12 const auto it = m_animation_map.constFind(w);-
13 if (it == m_animation_map.cend()
it == m_animation_map.cend()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
14 return;
never executed: return;
0
15 QPropertyAnimation *anim = *it;-
16 m_animation_map.erase(it);-
17 if (anim
animDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
18 anim->stop();-
19 }
never executed: end of block
0
20-
21 m_mainWindowLayout->animationFinished(w);-
22-
23-
24-
25-
26}
never executed: end of block
0
27-
28-
29void QWidgetAnimator::animationFinished()-
30{-
31 QPropertyAnimation *anim = qobject_cast<QPropertyAnimation*>(sender());-
32 abort(static_cast<QWidget*>(anim->targetObject()));
never executed: abort(static_cast<QWidget*>(anim->targetObject()));
0
33}-
34-
35-
36void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, bool animate)-
37{-
38 QRect r = widget->geometry();-
39 if (r.right() < 0
r.right() < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| r.bottom() < 0
r.bottom() < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
40 r = QRect();
never executed: r = QRect();
0
41-
42 animate = animate
animateDescription
TRUEnever evaluated
FALSEnever evaluated
&& !r.isNull()
!r.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
&& !_final_geometry.isNull()
!_final_geometry.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
43-
44-
45 const QRect final_geometry = _final_geometry.isValid()
_final_geometry.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| widget->isWindow()
widget->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
? _final_geometry :
0
46 QRect(QPoint(-500 - widget->width(), -500 - widget->height()), widget->size());-
47-
48-
49-
50 if (widget->style()->styleHint(QStyle::SH_Widget_Animate, 0, widget)
widget->style(...te, 0, widget)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
51 AnimationMap::const_iterator it = m_animation_map.constFind(widget);-
52 if (it != m_animation_map.constEnd()
it != m_animat...map.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
&& (*
(*it)->endValu...final_geometryDescription
TRUEnever evaluated
FALSEnever evaluated
it)->endValue().toRect() == final_geometry
(*it)->endValu...final_geometryDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
53 return;
never executed: return;
0
54-
55 QPropertyAnimation *anim = new QPropertyAnimation(widget, "geometry", widget);-
56 anim->setDuration(animate ? 200 : 0);-
57 anim->setEasingCurve(QEasingCurve::InOutQuad);-
58 anim->setEndValue(final_geometry);-
59 m_animation_map[widget] = anim;-
60 connect(anim, qFlagLocation("2""finished()" "\0" __FILE__ ":" "104"), qFlagLocation("1""animationFinished()" "\0" __FILE__ ":" "104"));-
61 anim->start(QPropertyAnimation::DeleteWhenStopped);-
62 }
never executed: end of block
else
0
63-
64 {-
65-
66 widget->setGeometry(final_geometry);-
67-
68 m_mainWindowLayout->animationFinished(widget);-
69-
70 }
never executed: end of block
0
71}-
72-
73bool QWidgetAnimator::animating() const-
74{-
75 return
never executed: return !m_animation_map.isEmpty();
!m_animation_map.isEmpty();
never executed: return !m_animation_map.isEmpty();
0
76}-
77-
78-
79-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9