Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/statemachine/qbasicmouseeventtransition.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | class QBasicMouseEventTransitionPrivate : public QAbstractTransitionPrivate | - | ||||||
7 | { | - | ||||||
8 | inline QBasicMouseEventTransition* q_func() { return static_cast<QBasicMouseEventTransition *>(q_ptr); } inline const QBasicMouseEventTransition* q_func() const { return static_cast<const QBasicMouseEventTransition *>(q_ptr); } friend class QBasicMouseEventTransition; | - | ||||||
9 | public: | - | ||||||
10 | QBasicMouseEventTransitionPrivate(); | - | ||||||
11 | - | |||||||
12 | static QBasicMouseEventTransitionPrivate *get(QBasicMouseEventTransition *q); | - | ||||||
13 | - | |||||||
14 | QEvent::Type eventType; | - | ||||||
15 | Qt::MouseButton button; | - | ||||||
16 | Qt::KeyboardModifiers modifierMask; | - | ||||||
17 | QPainterPath path; | - | ||||||
18 | }; | - | ||||||
19 | - | |||||||
20 | QBasicMouseEventTransitionPrivate::QBasicMouseEventTransitionPrivate() | - | ||||||
21 | { | - | ||||||
22 | eventType = QEvent::None; | - | ||||||
23 | button = Qt::NoButton; | - | ||||||
24 | } never executed: end of block | 0 | ||||||
25 | - | |||||||
26 | QBasicMouseEventTransitionPrivate *QBasicMouseEventTransitionPrivate::get(QBasicMouseEventTransition *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 | QBasicMouseEventTransition::QBasicMouseEventTransition(QState *sourceState) | - | ||||||
35 | : QAbstractTransition(*new QBasicMouseEventTransitionPrivate, sourceState) | - | ||||||
36 | { | - | ||||||
37 | } never executed: end of block | 0 | ||||||
38 | - | |||||||
39 | - | |||||||
40 | - | |||||||
41 | - | |||||||
42 | QBasicMouseEventTransition::QBasicMouseEventTransition(QEvent::Type type, | - | ||||||
43 | Qt::MouseButton button, | - | ||||||
44 | QState *sourceState) | - | ||||||
45 | : QAbstractTransition(*new QBasicMouseEventTransitionPrivate, sourceState) | - | ||||||
46 | { | - | ||||||
47 | QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
48 | d->eventType = type; | - | ||||||
49 | d->button = button; | - | ||||||
50 | } never executed: end of block | 0 | ||||||
51 | - | |||||||
52 | - | |||||||
53 | - | |||||||
54 | - | |||||||
55 | QBasicMouseEventTransition::~QBasicMouseEventTransition() | - | ||||||
56 | { | - | ||||||
57 | } | - | ||||||
58 | - | |||||||
59 | - | |||||||
60 | - | |||||||
61 | - | |||||||
62 | QEvent::Type QBasicMouseEventTransition::eventType() const | - | ||||||
63 | { | - | ||||||
64 | const QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
65 | return never executed: d->eventType;return d->eventType; never executed: return d->eventType; | 0 | ||||||
66 | } | - | ||||||
67 | - | |||||||
68 | - | |||||||
69 | - | |||||||
70 | - | |||||||
71 | void QBasicMouseEventTransition::setEventType(QEvent::Type type) | - | ||||||
72 | { | - | ||||||
73 | QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
74 | d->eventType = type; | - | ||||||
75 | } never executed: end of block | 0 | ||||||
76 | - | |||||||
77 | - | |||||||
78 | - | |||||||
79 | - | |||||||
80 | Qt::MouseButton QBasicMouseEventTransition::button() const | - | ||||||
81 | { | - | ||||||
82 | const QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
83 | return never executed: d->button;return d->button; never executed: return d->button; | 0 | ||||||
84 | } | - | ||||||
85 | - | |||||||
86 | - | |||||||
87 | - | |||||||
88 | - | |||||||
89 | void QBasicMouseEventTransition::setButton(Qt::MouseButton button) | - | ||||||
90 | { | - | ||||||
91 | QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
92 | d->button = button; | - | ||||||
93 | } never executed: end of block | 0 | ||||||
94 | - | |||||||
95 | - | |||||||
96 | - | |||||||
97 | - | |||||||
98 | - | |||||||
99 | Qt::KeyboardModifiers QBasicMouseEventTransition::modifierMask() const | - | ||||||
100 | { | - | ||||||
101 | const QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
102 | return never executed: d->modifierMask;return d->modifierMask; never executed: return d->modifierMask; | 0 | ||||||
103 | } | - | ||||||
104 | - | |||||||
105 | - | |||||||
106 | - | |||||||
107 | - | |||||||
108 | - | |||||||
109 | void QBasicMouseEventTransition::setModifierMask(Qt::KeyboardModifiers modifierMask) | - | ||||||
110 | { | - | ||||||
111 | QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
112 | d->modifierMask = modifierMask; | - | ||||||
113 | } never executed: end of block | 0 | ||||||
114 | - | |||||||
115 | - | |||||||
116 | - | |||||||
117 | - | |||||||
118 | QPainterPath QBasicMouseEventTransition::hitTestPath() const | - | ||||||
119 | { | - | ||||||
120 | const QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
121 | return never executed: d->path;return d->path; never executed: return d->path; | 0 | ||||||
122 | } | - | ||||||
123 | - | |||||||
124 | - | |||||||
125 | - | |||||||
126 | - | |||||||
127 | void QBasicMouseEventTransition::setHitTestPath(const QPainterPath &path) | - | ||||||
128 | { | - | ||||||
129 | QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
130 | d->path = path; | - | ||||||
131 | } never executed: end of block | 0 | ||||||
132 | - | |||||||
133 | - | |||||||
134 | - | |||||||
135 | - | |||||||
136 | bool QBasicMouseEventTransition::eventTest(QEvent *event) | - | ||||||
137 | { | - | ||||||
138 | const QBasicMouseEventTransitionPrivate * const d = d_func(); | - | ||||||
139 | if (event->type() == d->eventType
| 0 | ||||||
140 | QMouseEvent *me = static_cast<QMouseEvent*>(event); | - | ||||||
141 | return never executed: (me->button() == d->button)return (me->button() == d->button) && ((me->modifiers() & d->modifierMask) == d->modifierMask) && (d->path.isEmpty() || d->path.contains(me->pos())); never executed: return (me->button() == d->button) && ((me->modifiers() & d->modifierMask) == d->modifierMask) && (d->path.isEmpty() || d->path.contains(me->pos())); | 0 | ||||||
142 | && ((me->modifiers() & d->modifierMask) == d->modifierMask) never executed: return (me->button() == d->button) && ((me->modifiers() & d->modifierMask) == d->modifierMask) && (d->path.isEmpty() || d->path.contains(me->pos())); | 0 | ||||||
143 | && (d->path.isEmpty() || d->path.contains(me->pos())); never executed: return (me->button() == d->button) && ((me->modifiers() & d->modifierMask) == d->modifierMask) && (d->path.isEmpty() || d->path.contains(me->pos())); | 0 | ||||||
144 | } | - | ||||||
145 | return never executed: false;return false; never executed: return false; | 0 | ||||||
146 | } | - | ||||||
147 | - | |||||||
148 | - | |||||||
149 | - | |||||||
150 | - | |||||||
151 | void QBasicMouseEventTransition::onTransition(QEvent *) | - | ||||||
152 | { | - | ||||||
153 | } | - | ||||||
154 | - | |||||||
155 | - | |||||||
156 | - | |||||||
Switch to Source code | Preprocessed file |