statemachine/qabstracttransition.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6QAbstractTransitionPrivate::QAbstractTransitionPrivate() -
7{ -
8} -
9 -
10QAbstractTransitionPrivate *QAbstractTransitionPrivate::get(QAbstractTransition *q) -
11{ -
12 return q->d_func();
executed: return q->d_func();
Execution Count:10839
10839
13} -
14 -
15QStateMachine *QAbstractTransitionPrivate::machine() const -
16{ -
17 QState *source = sourceState(); -
18 if (!source)
evaluated: !source
TRUEFALSE
yes
Evaluation Count:76
yes
Evaluation Count:400147
76-400147
19 return 0;
executed: return 0;
Execution Count:76
76
20 return source->machine();
executed: return source->machine();
Execution Count:400152
400152
21} -
22 -
23bool QAbstractTransitionPrivate::callEventTest(QEvent *e) -
24{ -
25 QAbstractTransition * const q = q_func(); -
26 return q->eventTest(e);
executed: return q->eventTest(e);
Execution Count:7888
7888
27} -
28 -
29void QAbstractTransitionPrivate::callOnTransition(QEvent *e) -
30{ -
31 QAbstractTransition * const q = q_func(); -
32 q->onTransition(e); -
33}
executed: }
Execution Count:1307
1307
34 -
35QState *QAbstractTransitionPrivate::sourceState() const -
36{ -
37 return qobject_cast<QState*>(parent);
executed: return qobject_cast<QState*>(parent);
Execution Count:604242
604242
38} -
39 -
40void QAbstractTransitionPrivate::emitTriggered() -
41{ -
42 QAbstractTransition * const q = q_func(); -
43 q->triggered(QAbstractTransition::QPrivateSignal()); -
44}
executed: }
Execution Count:1368
1368
45 -
46 -
47 -
48 -
49QAbstractTransition::QAbstractTransition(QState *sourceState) -
50 : QObject(*new QAbstractTransitionPrivate, sourceState) -
51{ -
52}
executed: }
Execution Count:282
282
53 -
54 -
55 -
56 -
57QAbstractTransition::QAbstractTransition(QAbstractTransitionPrivate &dd, -
58 QState *parent) -
59 : QObject(dd, parent) -
60{ -
61}
executed: }
Execution Count:82
82
62 -
63 -
64 -
65 -
66QAbstractTransition::~QAbstractTransition() -
67{ -
68} -
69 -
70 -
71 -
72 -
73 -
74QState *QAbstractTransition::sourceState() const -
75{ -
76 const QAbstractTransitionPrivate * const d = d_func(); -
77 return d->sourceState();
executed: return d->sourceState();
Execution Count:204011
204011
78} -
79 -
80 -
81 -
82 -
83 -
84QAbstractState *QAbstractTransition::targetState() const -
85{ -
86 const QAbstractTransitionPrivate * const d = d_func(); -
87 if (d->targetStates.isEmpty())
evaluated: d->targetStates.isEmpty()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:15
2-15
88 return 0;
executed: return 0;
Execution Count:2
2
89 return d->targetStates.first().data();
executed: return d->targetStates.first().data();
Execution Count:15
15
90} -
91 -
92 -
93 -
94 -
95void QAbstractTransition::setTargetState(QAbstractState* target) -
96{ -
97 QAbstractTransitionPrivate * const d = d_func(); -
98 if (!target)
evaluated: !target
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:210
3-210
99 d->targetStates.clear();
executed: d->targetStates.clear();
Execution Count:3
3
100 else -
101 setTargetStates(QList<QAbstractState*>() << target);
executed: setTargetStates(QList<QAbstractState*>() << target);
Execution Count:210
210
102} -
103 -
104 -
105 -
106 -
107 -
108QList<QAbstractState*> QAbstractTransition::targetStates() const -
109{ -
110 const QAbstractTransitionPrivate * const d = d_func(); -
111 QList<QAbstractState*> result; -
112 for (int i = 0; i < d->targetStates.size(); ++i) {
evaluated: i < d->targetStates.size()
TRUEFALSE
yes
Evaluation Count:3970
yes
Evaluation Count:3978
3970-3978
113 QAbstractState *target = d->targetStates.at(i).data(); -
114 if (target)
evaluated: target
TRUEFALSE
yes
Evaluation Count:3969
yes
Evaluation Count:1
1-3969
115 result.append(target);
executed: result.append(target);
Execution Count:3969
3969
116 }
executed: }
Execution Count:3970
3970
117 return result;
executed: return result;
Execution Count:3978
3978
118} -
119 -
120 -
121 -
122 -
123void QAbstractTransition::setTargetStates(const QList<QAbstractState*> &targets) -
124{ -
125 QAbstractTransitionPrivate * const d = d_func(); -
126 -
127 for (int i = 0; i < targets.size(); ++i) {
evaluated: i < targets.size()
TRUEFALSE
yes
Evaluation Count:358
yes
Evaluation Count:355
355-358
128 QAbstractState *target = targets.at(i); -
129 if (!target) {
evaluated: !target
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:357
1-357
130 QMessageLogger("statemachine/qabstracttransition.cpp", 236, __PRETTY_FUNCTION__).warning("QAbstractTransition::setTargetStates: target state(s) cannot be null"); -
131 return;
executed: return;
Execution Count:1
1
132 } -
133 }
executed: }
Execution Count:357
357
134 -
135 d->targetStates.clear(); -
136 for (int i = 0; i < targets.size(); ++i)
evaluated: i < targets.size()
TRUEFALSE
yes
Evaluation Count:357
yes
Evaluation Count:355
355-357
137 d->targetStates.append(targets.at(i));
executed: d->targetStates.append(targets.at(i));
Execution Count:357
357
138}
executed: }
Execution Count:355
355
139 -
140 -
141 -
142 -
143 -
144QStateMachine *QAbstractTransition::machine() const -
145{ -
146 const QAbstractTransitionPrivate * const d = d_func(); -
147 return d->machine();
executed: return d->machine();
Execution Count:133
133
148} -
149void QAbstractTransition::addAnimation(QAbstractAnimation *animation) -
150{ -
151 QAbstractTransitionPrivate * const d = d_func(); -
152 if (!animation) {
evaluated: !animation
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:26
1-26
153 QMessageLogger("statemachine/qabstracttransition.cpp", 268, __PRETTY_FUNCTION__).warning("QAbstractTransition::addAnimation: cannot add null animation"); -
154 return;
executed: return;
Execution Count:1
1
155 } -
156 d->animations.append(animation); -
157}
executed: }
Execution Count:26
26
158 -
159 -
160 -
161 -
162 -
163 -
164void QAbstractTransition::removeAnimation(QAbstractAnimation *animation) -
165{ -
166 QAbstractTransitionPrivate * const d = d_func(); -
167 if (!animation) {
evaluated: !animation
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
168 QMessageLogger("statemachine/qabstracttransition.cpp", 283, __PRETTY_FUNCTION__).warning("QAbstractTransition::removeAnimation: cannot remove null animation"); -
169 return;
executed: return;
Execution Count:1
1
170 } -
171 d->animations.removeOne(animation); -
172}
executed: }
Execution Count:1
1
173 -
174 -
175 -
176 -
177 -
178 -
179 -
180QList<QAbstractAnimation*> QAbstractTransition::animations() const -
181{ -
182 const QAbstractTransitionPrivate * const d = d_func(); -
183 return d->animations;
executed: return d->animations;
Execution Count:1374
1374
184} -
185bool QAbstractTransition::event(QEvent *e) -
186{ -
187 return QObject::event(e);
executed: return QObject::event(e);
Execution Count:4
4
188} -
189 -
190 -
191 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial