statemachine/qbasickeyeventtransition.cpp

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

Generated by Squish Coco Non-Commercial