animation/qpauseanimation.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtCore module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42/*! -
43 \class QPauseAnimation -
44 \inmodule QtCore -
45 \brief The QPauseAnimation class provides a pause for QSequentialAnimationGroup. -
46 \since 4.6 -
47 \ingroup animation -
48 -
49 If you wish to introduce a delay between animations in a -
50 QSequentialAnimationGroup, you can insert a QPauseAnimation. This -
51 class does not animate anything, but does not -
52 \l{QAbstractAnimation::finished()}{finish} before a specified -
53 number of milliseconds have elapsed from when it was started. You -
54 specify the duration of the pause in the constructor. It can also -
55 be set directly with setDuration(). -
56 -
57 It is not necessary to construct a QPauseAnimation yourself. -
58 QSequentialAnimationGroup provides the convenience functions -
59 \l{QSequentialAnimationGroup::}{addPause()} and -
60 \l{QSequentialAnimationGroup::}{insertPause()}. These functions -
61 simply take the number of milliseconds the pause should last. -
62 -
63 \sa QSequentialAnimationGroup -
64*/ -
65 -
66#include "qpauseanimation.h" -
67#include "qabstractanimation_p.h" -
68 -
69 -
70#ifndef QT_NO_ANIMATION -
71 -
72QT_BEGIN_NAMESPACE -
73 -
74class QPauseAnimationPrivate : public QAbstractAnimationPrivate -
75{ -
76public: -
77 QPauseAnimationPrivate() : QAbstractAnimationPrivate(), duration(250) -
78 { -
79 isPause = true;
executed (the execution status of this line is deduced): isPause = true;
-
80 }
executed: }
Execution Count:41
41
81 -
82 int duration; -
83}; -
84 -
85/*! -
86 Constructs a QPauseAnimation. -
87 \a parent is passed to QObject's constructor. -
88 The default duration is 0. -
89*/ -
90 -
91QPauseAnimation::QPauseAnimation(QObject *parent) : QAbstractAnimation(*new QPauseAnimationPrivate, parent) -
92{ -
93}
executed: }
Execution Count:19
19
94 -
95/*! -
96 Constructs a QPauseAnimation. -
97 \a msecs is the duration of the pause. -
98 \a parent is passed to QObject's constructor. -
99*/ -
100 -
101QPauseAnimation::QPauseAnimation(int msecs, QObject *parent) : QAbstractAnimation(*new QPauseAnimationPrivate, parent) -
102{ -
103 setDuration(msecs);
executed (the execution status of this line is deduced): setDuration(msecs);
-
104}
executed: }
Execution Count:22
22
105 -
106/*! -
107 Destroys the pause animation. -
108*/ -
109QPauseAnimation::~QPauseAnimation() -
110{ -
111} -
112 -
113/*! -
114 \property QPauseAnimation::duration -
115 \brief the duration of the pause. -
116 -
117 The duration of the pause. The duration should not be negative. -
118 The default duration is 250 milliseconds. -
119*/ -
120int QPauseAnimation::duration() const -
121{ -
122 Q_D(const QPauseAnimation);
executed (the execution status of this line is deduced): const QPauseAnimationPrivate * const d = d_func();
-
123 return d->duration;
executed: return d->duration;
Execution Count:2084
2084
124} -
125 -
126void QPauseAnimation::setDuration(int msecs) -
127{ -
128 if (msecs < 0) {
partially evaluated: msecs < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:41
0-41
129 qWarning("QPauseAnimation::setDuration: cannot set a negative duration");
never executed (the execution status of this line is deduced): QMessageLogger("animation/qpauseanimation.cpp", 129, __PRETTY_FUNCTION__).warning("QPauseAnimation::setDuration: cannot set a negative duration");
-
130 return;
never executed: return;
0
131 } -
132 Q_D(QPauseAnimation);
executed (the execution status of this line is deduced): QPauseAnimationPrivate * const d = d_func();
-
133 d->duration = msecs;
executed (the execution status of this line is deduced): d->duration = msecs;
-
134}
executed: }
Execution Count:41
41
135 -
136/*! -
137 \reimp -
138 */ -
139bool QPauseAnimation::event(QEvent *e) -
140{ -
141 return QAbstractAnimation::event(e);
never executed: return QAbstractAnimation::event(e);
0
142} -
143 -
144/*! -
145 \reimp -
146 */ -
147void QPauseAnimation::updateCurrentTime(int) -
148{ -
149} -
150 -
151 -
152QT_END_NAMESPACE -
153 -
154#include "moc_qpauseanimation.cpp" -
155 -
156#endif //QT_NO_ANIMATION -
157 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial