statemachine/qeventtransition.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6QEventTransitionPrivate::QEventTransitionPrivate() -
7{ -
8 object = 0; -
9 eventType = QEvent::None; -
10 registered = false; -
11}
executed: }
Execution Count:18
18
12 -
13QEventTransitionPrivate *QEventTransitionPrivate::get(QEventTransition *q) -
14{ -
15 return q->d_func();
executed: return q->d_func();
Execution Count:139
139
16} -
17 -
18void QEventTransitionPrivate::unregister() -
19{ -
20 QEventTransition * const q = q_func(); -
21 if (!registered || !machine())
evaluated: !registered
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:3
partially evaluated: !machine()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-10
22 return;
executed: return;
Execution Count:10
10
23 QStateMachinePrivate::get(machine())->unregisterEventTransition(q); -
24}
executed: }
Execution Count:3
3
25 -
26void QEventTransitionPrivate::maybeRegister() -
27{ -
28 QEventTransition * const q = q_func(); -
29 if (QStateMachine *mach = machine())
evaluated: QStateMachine *mach = machine()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:18
7-18
30 QStateMachinePrivate::get(mach)->maybeRegisterEventTransition(q);
executed: QStateMachinePrivate::get(mach)->maybeRegisterEventTransition(q);
Execution Count:7
7
31}
executed: }
Execution Count:25
25
32 -
33 -
34 -
35 -
36QEventTransition::QEventTransition(QState *sourceState) -
37 : QAbstractTransition(*new QEventTransitionPrivate, sourceState) -
38{ -
39}
executed: }
Execution Count:4
4
40 -
41 -
42 -
43 -
44 -
45QEventTransition::QEventTransition(QObject *object, QEvent::Type type, -
46 QState *sourceState) -
47 : QAbstractTransition(*new QEventTransitionPrivate, sourceState) -
48{ -
49 QEventTransitionPrivate * const d = d_func(); -
50 d->registered = false; -
51 d->object = object; -
52 d->eventType = type; -
53 d->maybeRegister(); -
54}
executed: }
Execution Count:10
10
55 -
56 -
57 -
58 -
59QEventTransition::QEventTransition(QEventTransitionPrivate &dd, QState *parent) -
60 : QAbstractTransition(dd, parent) -
61{ -
62}
executed: }
Execution Count:2
2
63 -
64 -
65 -
66 -
67QEventTransition::QEventTransition(QEventTransitionPrivate &dd, QObject *object, -
68 QEvent::Type type, QState *parent) -
69 : QAbstractTransition(dd, parent) -
70{ -
71 QEventTransitionPrivate * const d = d_func(); -
72 d->registered = false; -
73 d->object = object; -
74 d->eventType = type; -
75 d->maybeRegister(); -
76}
executed: }
Execution Count:2
2
77 -
78 -
79 -
80 -
81QEventTransition::~QEventTransition() -
82{ -
83} -
84 -
85 -
86 -
87 -
88QEvent::Type QEventTransition::eventType() const -
89{ -
90 const QEventTransitionPrivate * const d = d_func(); -
91 return d->eventType;
executed: return d->eventType;
Execution Count:100
100
92} -
93 -
94 -
95 -
96 -
97void QEventTransition::setEventType(QEvent::Type type) -
98{ -
99 QEventTransitionPrivate * const d = d_func(); -
100 if (d->eventType == type)
partially evaluated: d->eventType == type
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
101 return;
never executed: return;
0
102 d->unregister(); -
103 d->eventType = type; -
104 d->maybeRegister(); -
105}
executed: }
Execution Count:7
7
106 -
107 -
108 -
109 -
110QObject *QEventTransition::eventSource() const -
111{ -
112 const QEventTransitionPrivate * const d = d_func(); -
113 return d->object;
executed: return d->object;
Execution Count:5
5
114} -
115 -
116 -
117 -
118 -
119 -
120void QEventTransition::setEventSource(QObject *object) -
121{ -
122 QEventTransitionPrivate * const d = d_func(); -
123 if (d->object == object)
partially evaluated: d->object == object
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
124 return;
never executed: return;
0
125 d->unregister(); -
126 d->object = object; -
127 d->maybeRegister(); -
128}
executed: }
Execution Count:6
6
129 -
130 -
131 -
132 -
133bool QEventTransition::eventTest(QEvent *event) -
134{ -
135 const QEventTransitionPrivate * const d = d_func(); -
136 if (event->type() == QEvent::StateMachineWrapped) {
evaluated: event->type() == QEvent::StateMachineWrapped
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:42
21-42
137 QStateMachine::WrappedEvent *we = static_cast<QStateMachine::WrappedEvent*>(event); -
138 return (we->object() == d->object) 21
139 && (we->event()->type() == d->eventType);
executed: return (we->object() == d->object) && (we->event()->type() == d->eventType);
Execution Count:21
21
140 } -
141 return false;
executed: return false;
Execution Count:42
42
142} -
143 -
144 -
145 -
146 -
147void QEventTransition::onTransition(QEvent *event) -
148{ -
149 (void)event;; -
150}
executed: }
Execution Count:20
20
151 -
152 -
153 -
154 -
155bool QEventTransition::event(QEvent *e) -
156{ -
157 return QAbstractTransition::event(e);
never executed: return QAbstractTransition::event(e);
0
158} -
159 -
160 -
161 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial