Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/statemachine/qbasickeyeventtransition.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | class 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; | - | ||||||
9 | public: | - | ||||||
10 | QBasicKeyEventTransitionPrivate(); | - | ||||||
11 | - | |||||||
12 | static QBasicKeyEventTransitionPrivate *get(QBasicKeyEventTransition *q); | - | ||||||
13 | - | |||||||
14 | QEvent::Type eventType; | - | ||||||
15 | int key; | - | ||||||
16 | Qt::KeyboardModifiers modifierMask; | - | ||||||
17 | }; | - | ||||||
18 | - | |||||||
19 | QBasicKeyEventTransitionPrivate::QBasicKeyEventTransitionPrivate() | - | ||||||
20 | { | - | ||||||
21 | eventType = QEvent::None; | - | ||||||
22 | key = 0; | - | ||||||
23 | modifierMask = Qt::NoModifier; | - | ||||||
24 | } never executed: end of block | 0 | ||||||
25 | - | |||||||
26 | QBasicKeyEventTransitionPrivate *QBasicKeyEventTransitionPrivate::get(QBasicKeyEventTransition *q) | - | ||||||
27 | { | - | ||||||
28 | return never executed: q->d_func();return q->d_func(); never executed: return q->d_func(); | 0 | ||||||
29 | } | - | ||||||
30 | - | |||||||
31 | - | |||||||
32 | - | |||||||
33 | - | |||||||
34 | QBasicKeyEventTransition::QBasicKeyEventTransition(QState *sourceState) | - | ||||||
35 | : QAbstractTransition(*new QBasicKeyEventTransitionPrivate, sourceState) | - | ||||||
36 | { | - | ||||||
37 | } never executed: end of block | 0 | ||||||
38 | - | |||||||
39 | - | |||||||
40 | - | |||||||
41 | - | |||||||
42 | - | |||||||
43 | QBasicKeyEventTransition::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 | - | |||||||
56 | QBasicKeyEventTransition::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 | - | |||||||
70 | QBasicKeyEventTransition::~QBasicKeyEventTransition() | - | ||||||
71 | { | - | ||||||
72 | } | - | ||||||
73 | - | |||||||
74 | - | |||||||
75 | - | |||||||
76 | - | |||||||
77 | QEvent::Type QBasicKeyEventTransition::eventType() const | - | ||||||
78 | { | - | ||||||
79 | const QBasicKeyEventTransitionPrivate * const d = d_func(); | - | ||||||
80 | return never executed: d->eventType;return d->eventType; never executed: return d->eventType; | 0 | ||||||
81 | } | - | ||||||
82 | - | |||||||
83 | - | |||||||
84 | - | |||||||
85 | - | |||||||
86 | void 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 | - | |||||||
95 | int QBasicKeyEventTransition::key() const | - | ||||||
96 | { | - | ||||||
97 | const QBasicKeyEventTransitionPrivate * const d = d_func(); | - | ||||||
98 | return never executed: d->key;return d->key; never executed: return d->key; | 0 | ||||||
99 | } | - | ||||||
100 | - | |||||||
101 | - | |||||||
102 | - | |||||||
103 | - | |||||||
104 | void 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 | - | |||||||
114 | Qt::KeyboardModifiers QBasicKeyEventTransition::modifierMask() const | - | ||||||
115 | { | - | ||||||
116 | const QBasicKeyEventTransitionPrivate * const d = d_func(); | - | ||||||
117 | return never executed: d->modifierMask;return d->modifierMask; never executed: return d->modifierMask; | 0 | ||||||
118 | } | - | ||||||
119 | - | |||||||
120 | - | |||||||
121 | - | |||||||
122 | - | |||||||
123 | - | |||||||
124 | void 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 | - | |||||||
133 | bool QBasicKeyEventTransition::eventTest(QEvent *event) | - | ||||||
134 | { | - | ||||||
135 | const QBasicKeyEventTransitionPrivate * const d = d_func(); | - | ||||||
136 | if (event->type() == d->eventType
| 0 | ||||||
137 | QKeyEvent *ke = static_cast<QKeyEvent*>(event); | - | ||||||
138 | return never executed: (ke->key() == d->key)return (ke->key() == d->key) && ((ke->modifiers() & d->modifierMask) == d->modifierMask); 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: false;return false; never executed: return false; | 0 | ||||||
142 | } | - | ||||||
143 | - | |||||||
144 | - | |||||||
145 | - | |||||||
146 | - | |||||||
147 | void QBasicKeyEventTransition::onTransition(QEvent *) | - | ||||||
148 | { | - | ||||||
149 | } | - | ||||||
150 | - | |||||||
151 | - | |||||||
152 | - | |||||||
Switch to Source code | Preprocessed file |