Line | Source Code | Coverage |
---|
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 | } executed: } Execution Count:2 | 2 |
25 | | - |
26 | QBasicMouseEventTransitionPrivate *QBasicMouseEventTransitionPrivate::get(QBasicMouseEventTransition *q) | - |
27 | { | - |
28 | 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 | } executed: } Execution Count:1 | 1 |
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 | } executed: } Execution Count:1 | 1 |
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 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 | } executed: } Execution Count:5 | 5 |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | Qt::MouseButton QBasicMouseEventTransition::button() const | - |
81 | { | - |
82 | const QBasicMouseEventTransitionPrivate * const d = d_func(); | - |
83 | return d->button; executed: return d->button; Execution Count:2 | 2 |
84 | } | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | void QBasicMouseEventTransition::setButton(Qt::MouseButton button) | - |
90 | { | - |
91 | QBasicMouseEventTransitionPrivate * const d = d_func(); | - |
92 | d->button = button; | - |
93 | } executed: } Execution Count:1 | 1 |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | Qt::KeyboardModifiers QBasicMouseEventTransition::modifierMask() const | - |
100 | { | - |
101 | const QBasicMouseEventTransitionPrivate * const d = d_func(); | - |
102 | 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 | } | 0 |
114 | | - |
115 | | - |
116 | | - |
117 | | - |
118 | QPainterPath QBasicMouseEventTransition::hitTestPath() const | - |
119 | { | - |
120 | const QBasicMouseEventTransitionPrivate * const d = d_func(); | - |
121 | 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 | } | 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) { partially evaluated: event->type() == d->eventType yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
140 | QMouseEvent *me = static_cast<QMouseEvent*>(event); | - |
141 | return (me->button() == d->button) | 5 |
142 | && ((me->modifiers() & d->modifierMask) == d->modifierMask) | 5 |
143 | && (d->path.isEmpty() || d->path.contains(me->pos())); executed: return (me->button() == d->button) && ((me->modifiers() & d->modifierMask) == d->modifierMask) && (d->path.isEmpty() || d->path.contains(me->pos())); Execution Count:5 | 5 |
144 | } | - |
145 | return false; never executed: return false; | 0 |
146 | } | - |
147 | | - |
148 | | - |
149 | | - |
150 | | - |
151 | void QBasicMouseEventTransition::onTransition(QEvent *) | - |
152 | { | - |
153 | } | - |
154 | | - |
155 | | - |
156 | | - |
| | |