Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | QAbstractTransitionPrivate::QAbstractTransitionPrivate() | - |
7 | { | - |
8 | } | - |
9 | | - |
10 | QAbstractTransitionPrivate *QAbstractTransitionPrivate::get(QAbstractTransition *q) | - |
11 | { | - |
12 | return q->d_func(); executed: return q->d_func(); Execution Count:10839 | 10839 |
13 | } | - |
14 | | - |
15 | QStateMachine *QAbstractTransitionPrivate::machine() const | - |
16 | { | - |
17 | QState *source = sourceState(); | - |
18 | if (!source) evaluated: !source 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 | | - |
23 | bool 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 | | - |
29 | void QAbstractTransitionPrivate::callOnTransition(QEvent *e) | - |
30 | { | - |
31 | QAbstractTransition * const q = q_func(); | - |
32 | q->onTransition(e); | - |
33 | } executed: } Execution Count:1307 | 1307 |
34 | | - |
35 | QState *QAbstractTransitionPrivate::sourceState() const | - |
36 | { | - |
37 | return qobject_cast<QState*>(parent); executed: return qobject_cast<QState*>(parent); Execution Count:604242 | 604242 |
38 | } | - |
39 | | - |
40 | void QAbstractTransitionPrivate::emitTriggered() | - |
41 | { | - |
42 | QAbstractTransition * const q = q_func(); | - |
43 | q->triggered(QAbstractTransition::QPrivateSignal()); | - |
44 | } executed: } Execution Count:1368 | 1368 |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | QAbstractTransition::QAbstractTransition(QState *sourceState) | - |
50 | : QObject(*new QAbstractTransitionPrivate, sourceState) | - |
51 | { | - |
52 | } executed: } Execution Count:282 | 282 |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | QAbstractTransition::QAbstractTransition(QAbstractTransitionPrivate &dd, | - |
58 | QState *parent) | - |
59 | : QObject(dd, parent) | - |
60 | { | - |
61 | } executed: } Execution Count:82 | 82 |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | QAbstractTransition::~QAbstractTransition() | - |
67 | { | - |
68 | } | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | QState *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 | | - |
84 | QAbstractState *QAbstractTransition::targetState() const | - |
85 | { | - |
86 | const QAbstractTransitionPrivate * const d = d_func(); | - |
87 | if (d->targetStates.isEmpty()) evaluated: d->targetStates.isEmpty() 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 | | - |
95 | void QAbstractTransition::setTargetState(QAbstractState* target) | - |
96 | { | - |
97 | QAbstractTransitionPrivate * const d = d_func(); | - |
98 | if (!target) evaluated: !target 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 | | - |
108 | QList<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() yes Evaluation Count:3970 | yes Evaluation Count:3978 |
| 3970-3978 |
113 | QAbstractState *target = d->targetStates.at(i).data(); | - |
114 | if (target) evaluated: target 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 | | - |
123 | void 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() yes Evaluation Count:358 | yes Evaluation Count:355 |
| 355-358 |
128 | QAbstractState *target = targets.at(i); | - |
129 | if (!target) { evaluated: !target 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() 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 | | - |
144 | QStateMachine *QAbstractTransition::machine() const | - |
145 | { | - |
146 | const QAbstractTransitionPrivate * const d = d_func(); | - |
147 | return d->machine(); executed: return d->machine(); Execution Count:133 | 133 |
148 | } | - |
149 | void QAbstractTransition::addAnimation(QAbstractAnimation *animation) | - |
150 | { | - |
151 | QAbstractTransitionPrivate * const d = d_func(); | - |
152 | if (!animation) { evaluated: !animation 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 | | - |
164 | void QAbstractTransition::removeAnimation(QAbstractAnimation *animation) | - |
165 | { | - |
166 | QAbstractTransitionPrivate * const d = d_func(); | - |
167 | if (!animation) { evaluated: !animation 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 | | - |
180 | QList<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 | } | - |
185 | bool QAbstractTransition::event(QEvent *e) | - |
186 | { | - |
187 | return QObject::event(e); executed: return QObject::event(e); Execution Count:4 | 4 |
188 | } | - |
189 | | - |
190 | | - |
191 | | - |
| | |