qeventtransition.cpp

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

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