qbasickeyeventtransition.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/statemachine/qbasickeyeventtransition.cpp
Switch to Source codePreprocessed file
LineSourceCount
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}
never executed: end of block
0
25-
26QBasicKeyEventTransitionPrivate *QBasicKeyEventTransitionPrivate::get(QBasicKeyEventTransition *q)-
27{-
28 return
never executed: return q->d_func();
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}
never executed: end of block
0
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}
never executed: end of block
0
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: end of block
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
never executed: return d->eventType;
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}
never executed: end of block
0
91-
92-
93-
94-
95int QBasicKeyEventTransition::key() const-
96{-
97 const QBasicKeyEventTransitionPrivate * const d = d_func();-
98 return
never executed: return d->key;
d->key;
never executed: return d->key;
0
99}-
100-
101-
102-
103-
104void QBasicKeyEventTransition::setKey(int key)-
105{-
106 QBasicKeyEventTransitionPrivate * const d = d_func();-
107 d->key = key;-
108}
never executed: end of block
0
109-
110-
111-
112-
113-
114Qt::KeyboardModifiers QBasicKeyEventTransition::modifierMask() const-
115{-
116 const QBasicKeyEventTransitionPrivate * const d = d_func();-
117 return
never executed: return d->modifierMask;
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: end of block
0
129-
130-
131-
132-
133bool QBasicKeyEventTransition::eventTest(QEvent *event)-
134{-
135 const QBasicKeyEventTransitionPrivate * const d = d_func();-
136 if (event->type() == d->eventType
event->type() == d->eventTypeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
137 QKeyEvent *ke = static_cast<QKeyEvent*>(event);-
138 return
never executed: return (ke->key() == d->key) && ((ke->modifiers() & d->modifierMask) == d->modifierMask);
(ke->key() == d->key)
never executed: return (ke->key() == d->key) && ((ke->modifiers() & d->modifierMask) == d->modifierMask);
0
139 && ((ke->modifiers() & d->modifierMask) == d->modifierMask);
never executed: return (ke->key() == d->key) && ((ke->modifiers() & d->modifierMask) == d->modifierMask);
0
140 }-
141 return
never executed: return false;
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 4.3.0-BETA-master-30-08-2018-4cb69e9