author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 02 Feb 2010 00:43:10 +0200 | |
changeset 3 | 41300fa6a67c |
parent 0 | 1918ee327afb |
child 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 |
** All rights reserved. |
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtGui module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#include <QtCore/qstatemachine.h> |
|
43 |
||
44 |
#ifndef QT_NO_STATEMACHINE |
|
45 |
||
46 |
#include <private/qstatemachine_p.h> |
|
47 |
#include <QtGui/qevent.h> |
|
48 |
#include <QtGui/qgraphicssceneevent.h> |
|
49 |
||
50 |
QT_BEGIN_NAMESPACE |
|
51 |
||
52 |
Q_CORE_EXPORT const QStateMachinePrivate::Handler *qcoreStateMachineHandler(); |
|
53 |
||
54 |
static QEvent *cloneEvent(QEvent *e) |
|
55 |
{ |
|
56 |
switch (e->type()) { |
|
57 |
case QEvent::MouseButtonPress: |
|
58 |
case QEvent::MouseButtonRelease: |
|
59 |
case QEvent::MouseButtonDblClick: |
|
60 |
case QEvent::MouseMove: |
|
61 |
return new QMouseEvent(*static_cast<QMouseEvent*>(e)); |
|
62 |
case QEvent::KeyPress: |
|
63 |
case QEvent::KeyRelease: |
|
64 |
return new QKeyEvent(*static_cast<QKeyEvent*>(e)); |
|
65 |
case QEvent::FocusIn: |
|
66 |
case QEvent::FocusOut: |
|
67 |
return new QFocusEvent(*static_cast<QFocusEvent*>(e)); |
|
68 |
case QEvent::Enter: |
|
69 |
return new QEvent(*e); |
|
70 |
case QEvent::Leave: |
|
71 |
return new QEvent(*e); |
|
72 |
break; |
|
73 |
case QEvent::Paint: |
|
74 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
75 |
break; |
|
76 |
case QEvent::Move: |
|
77 |
return new QMoveEvent(*static_cast<QMoveEvent*>(e)); |
|
78 |
case QEvent::Resize: |
|
79 |
return new QResizeEvent(*static_cast<QResizeEvent*>(e)); |
|
80 |
case QEvent::Create: |
|
81 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
82 |
break; |
|
83 |
case QEvent::Destroy: |
|
84 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
85 |
break; |
|
86 |
case QEvent::Show: |
|
87 |
return new QShowEvent(*static_cast<QShowEvent*>(e)); |
|
88 |
case QEvent::Hide: |
|
89 |
return new QHideEvent(*static_cast<QHideEvent*>(e)); |
|
90 |
case QEvent::Close: |
|
91 |
return new QCloseEvent(*static_cast<QCloseEvent*>(e)); |
|
92 |
case QEvent::Quit: |
|
93 |
return new QEvent(*e); |
|
94 |
case QEvent::ParentChange: |
|
95 |
return new QEvent(*e); |
|
96 |
case QEvent::ParentAboutToChange: |
|
97 |
return new QEvent(*e); |
|
98 |
case QEvent::ThreadChange: |
|
99 |
return new QEvent(*e); |
|
100 |
||
101 |
case QEvent::WindowActivate: |
|
102 |
case QEvent::WindowDeactivate: |
|
103 |
return new QEvent(*e); |
|
104 |
||
105 |
case QEvent::ShowToParent: |
|
106 |
return new QEvent(*e); |
|
107 |
case QEvent::HideToParent: |
|
108 |
return new QEvent(*e); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
109 |
#ifndef QT_NO_WHEELEVENT |
0 | 110 |
case QEvent::Wheel: |
111 |
return new QWheelEvent(*static_cast<QWheelEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
112 |
#endif //QT_NO_WHEELEVENT |
0 | 113 |
case QEvent::WindowTitleChange: |
114 |
return new QEvent(*e); |
|
115 |
case QEvent::WindowIconChange: |
|
116 |
return new QEvent(*e); |
|
117 |
case QEvent::ApplicationWindowIconChange: |
|
118 |
return new QEvent(*e); |
|
119 |
case QEvent::ApplicationFontChange: |
|
120 |
return new QEvent(*e); |
|
121 |
case QEvent::ApplicationLayoutDirectionChange: |
|
122 |
return new QEvent(*e); |
|
123 |
case QEvent::ApplicationPaletteChange: |
|
124 |
return new QEvent(*e); |
|
125 |
case QEvent::PaletteChange: |
|
126 |
return new QEvent(*e); |
|
127 |
case QEvent::Clipboard: |
|
128 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
129 |
break; |
|
130 |
case QEvent::Speech: |
|
131 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
132 |
break; |
|
133 |
case QEvent::MetaCall: |
|
134 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
135 |
break; |
|
136 |
case QEvent::SockAct: |
|
137 |
return new QEvent(*e); |
|
138 |
case QEvent::WinEventAct: |
|
139 |
return new QEvent(*e); |
|
140 |
case QEvent::DeferredDelete: |
|
141 |
return new QEvent(*e); |
|
142 |
#ifndef QT_NO_DRAGANDDROP |
|
143 |
case QEvent::DragEnter: |
|
144 |
return new QDragEnterEvent(*static_cast<QDragEnterEvent*>(e)); |
|
145 |
case QEvent::DragMove: |
|
146 |
return new QDragMoveEvent(*static_cast<QDragMoveEvent*>(e)); |
|
147 |
case QEvent::DragLeave: |
|
148 |
return new QDragLeaveEvent(*static_cast<QDragLeaveEvent*>(e)); |
|
149 |
case QEvent::Drop: |
|
150 |
return new QDropEvent(*static_cast<QDragMoveEvent*>(e)); |
|
151 |
case QEvent::DragResponse: |
|
152 |
return new QDragResponseEvent(*static_cast<QDragResponseEvent*>(e)); |
|
153 |
#endif |
|
154 |
case QEvent::ChildAdded: |
|
155 |
return new QChildEvent(*static_cast<QChildEvent*>(e)); |
|
156 |
case QEvent::ChildPolished: |
|
157 |
return new QChildEvent(*static_cast<QChildEvent*>(e)); |
|
158 |
#ifdef QT3_SUPPORT |
|
159 |
case QEvent::ChildInsertedRequest: |
|
160 |
return new QEvent(*e); |
|
161 |
case QEvent::ChildInserted: |
|
162 |
return new QChildEvent(*static_cast<QChildEvent*>(e)); |
|
163 |
case QEvent::LayoutHint: |
|
164 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
165 |
break; |
|
166 |
#endif |
|
167 |
case QEvent::ChildRemoved: |
|
168 |
return new QChildEvent(*static_cast<QChildEvent*>(e)); |
|
169 |
case QEvent::ShowWindowRequest: |
|
170 |
return new QEvent(*e); |
|
171 |
case QEvent::PolishRequest: |
|
172 |
return new QEvent(*e); |
|
173 |
case QEvent::Polish: |
|
174 |
return new QEvent(*e); |
|
175 |
case QEvent::LayoutRequest: |
|
176 |
return new QEvent(*e); |
|
177 |
case QEvent::UpdateRequest: |
|
178 |
return new QEvent(*e); |
|
179 |
case QEvent::UpdateLater: |
|
180 |
return new QEvent(*e); |
|
181 |
||
182 |
case QEvent::EmbeddingControl: |
|
183 |
return new QEvent(*e); |
|
184 |
case QEvent::ActivateControl: |
|
185 |
return new QEvent(*e); |
|
186 |
case QEvent::DeactivateControl: |
|
187 |
return new QEvent(*e); |
|
188 |
||
189 |
case QEvent::ContextMenu: |
|
190 |
return new QContextMenuEvent(*static_cast<QContextMenuEvent*>(e)); |
|
191 |
case QEvent::InputMethod: |
|
192 |
return new QInputMethodEvent(*static_cast<QInputMethodEvent*>(e)); |
|
193 |
case QEvent::AccessibilityPrepare: |
|
194 |
return new QEvent(*e); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
195 |
#ifndef QT_NO_TABLETEVENT |
0 | 196 |
case QEvent::TabletMove: |
197 |
return new QTabletEvent(*static_cast<QTabletEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
198 |
#endif //QT_NO_TABLETEVENT |
0 | 199 |
case QEvent::LocaleChange: |
200 |
return new QEvent(*e); |
|
201 |
case QEvent::LanguageChange: |
|
202 |
return new QEvent(*e); |
|
203 |
case QEvent::LayoutDirectionChange: |
|
204 |
return new QEvent(*e); |
|
205 |
case QEvent::Style: |
|
206 |
return new QEvent(*e); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
207 |
#ifndef QT_NO_TABLETEVENT |
0 | 208 |
case QEvent::TabletPress: |
209 |
return new QTabletEvent(*static_cast<QTabletEvent*>(e)); |
|
210 |
case QEvent::TabletRelease: |
|
211 |
return new QTabletEvent(*static_cast<QTabletEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
212 |
#endif //QT_NO_TABLETEVENT |
0 | 213 |
case QEvent::OkRequest: |
214 |
return new QEvent(*e); |
|
215 |
case QEvent::HelpRequest: |
|
216 |
return new QEvent(*e); |
|
217 |
||
218 |
case QEvent::IconDrag: |
|
219 |
return new QIconDragEvent(*static_cast<QIconDragEvent*>(e)); |
|
220 |
||
221 |
case QEvent::FontChange: |
|
222 |
return new QEvent(*e); |
|
223 |
case QEvent::EnabledChange: |
|
224 |
return new QEvent(*e); |
|
225 |
case QEvent::ActivationChange: |
|
226 |
return new QEvent(*e); |
|
227 |
case QEvent::StyleChange: |
|
228 |
return new QEvent(*e); |
|
229 |
case QEvent::IconTextChange: |
|
230 |
return new QEvent(*e); |
|
231 |
case QEvent::ModifiedChange: |
|
232 |
return new QEvent(*e); |
|
233 |
case QEvent::MouseTrackingChange: |
|
234 |
return new QEvent(*e); |
|
235 |
||
236 |
case QEvent::WindowBlocked: |
|
237 |
return new QEvent(*e); |
|
238 |
case QEvent::WindowUnblocked: |
|
239 |
return new QEvent(*e); |
|
240 |
case QEvent::WindowStateChange: |
|
241 |
return new QWindowStateChangeEvent(*static_cast<QWindowStateChangeEvent*>(e)); |
|
242 |
||
243 |
case QEvent::ToolTip: |
|
244 |
return new QHelpEvent(*static_cast<QHelpEvent*>(e)); |
|
245 |
case QEvent::WhatsThis: |
|
246 |
return new QHelpEvent(*static_cast<QHelpEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
247 |
#ifndef QT_NO_STATUSTIP |
0 | 248 |
case QEvent::StatusTip: |
249 |
return new QStatusTipEvent(*static_cast<QStatusTipEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
#endif //QT_NO_STATUSTIP |
0 | 251 |
#ifndef QT_NO_ACTION |
252 |
case QEvent::ActionChanged: |
|
253 |
case QEvent::ActionAdded: |
|
254 |
case QEvent::ActionRemoved: |
|
255 |
return new QActionEvent(*static_cast<QActionEvent*>(e)); |
|
256 |
#endif |
|
257 |
case QEvent::FileOpen: |
|
258 |
return new QFileOpenEvent(*static_cast<QFileOpenEvent*>(e)); |
|
259 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
260 |
#ifndef QT_NO_SHORTCUT |
0 | 261 |
case QEvent::Shortcut: |
262 |
return new QShortcutEvent(*static_cast<QShortcutEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
263 |
#endif //QT_NO_SHORTCUT |
0 | 264 |
case QEvent::ShortcutOverride: |
265 |
return new QKeyEvent(*static_cast<QKeyEvent*>(e)); |
|
266 |
||
267 |
#ifdef QT3_SUPPORT |
|
268 |
case QEvent::Accel: |
|
269 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
270 |
break; |
|
271 |
case QEvent::AccelAvailable: |
|
272 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
273 |
break; |
|
274 |
#endif |
|
275 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
276 |
#ifndef QT_NO_WHATSTHIS |
0 | 277 |
case QEvent::WhatsThisClicked: |
278 |
return new QWhatsThisClickedEvent(*static_cast<QWhatsThisClickedEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
279 |
#endif //QT_NO_WHATSTHIS |
0 | 280 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
281 |
#ifndef QT_NO_TOOLBAR |
0 | 282 |
case QEvent::ToolBarChange: |
283 |
return new QToolBarChangeEvent(*static_cast<QToolBarChangeEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
284 |
#endif //QT_NO_TOOLBAR |
0 | 285 |
|
286 |
case QEvent::ApplicationActivate: |
|
287 |
return new QEvent(*e); |
|
288 |
case QEvent::ApplicationDeactivate: |
|
289 |
return new QEvent(*e); |
|
290 |
||
291 |
case QEvent::QueryWhatsThis: |
|
292 |
return new QHelpEvent(*static_cast<QHelpEvent*>(e)); |
|
293 |
case QEvent::EnterWhatsThisMode: |
|
294 |
return new QEvent(*e); |
|
295 |
case QEvent::LeaveWhatsThisMode: |
|
296 |
return new QEvent(*e); |
|
297 |
||
298 |
case QEvent::ZOrderChange: |
|
299 |
return new QEvent(*e); |
|
300 |
||
301 |
case QEvent::HoverEnter: |
|
302 |
case QEvent::HoverLeave: |
|
303 |
case QEvent::HoverMove: |
|
304 |
return new QHoverEvent(*static_cast<QHoverEvent*>(e)); |
|
305 |
||
306 |
case QEvent::AccessibilityHelp: |
|
307 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
308 |
break; |
|
309 |
case QEvent::AccessibilityDescription: |
|
310 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
311 |
break; |
|
312 |
||
313 |
#ifdef QT_KEYPAD_NAVIGATION |
|
314 |
case QEvent::EnterEditFocus: |
|
315 |
return new QEvent(*e); |
|
316 |
case QEvent::LeaveEditFocus: |
|
317 |
return new QEvent(*e); |
|
318 |
#endif |
|
319 |
case QEvent::AcceptDropsChange: |
|
320 |
return new QEvent(*e); |
|
321 |
||
322 |
#ifdef QT3_SUPPORT |
|
323 |
case QEvent::MenubarUpdated: |
|
324 |
return new QMenubarUpdatedEvent(*static_cast<QMenubarUpdatedEvent*>(e)); |
|
325 |
#endif |
|
326 |
||
327 |
case QEvent::ZeroTimerEvent: |
|
328 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
329 |
break; |
|
330 |
#ifndef QT_NO_GRAPHICSVIEW |
|
331 |
case QEvent::GraphicsSceneMouseMove: |
|
332 |
case QEvent::GraphicsSceneMousePress: |
|
333 |
case QEvent::GraphicsSceneMouseRelease: |
|
334 |
case QEvent::GraphicsSceneMouseDoubleClick: { |
|
335 |
QGraphicsSceneMouseEvent *me = static_cast<QGraphicsSceneMouseEvent*>(e); |
|
336 |
QGraphicsSceneMouseEvent *me2 = new QGraphicsSceneMouseEvent(me->type()); |
|
337 |
me2->setWidget(me->widget()); |
|
338 |
me2->setPos(me->pos()); |
|
339 |
me2->setScenePos(me->scenePos()); |
|
340 |
me2->setScreenPos(me->screenPos()); |
|
341 |
// ### for all buttons |
|
342 |
me2->setButtonDownPos(Qt::LeftButton, me->buttonDownPos(Qt::LeftButton)); |
|
343 |
me2->setButtonDownPos(Qt::RightButton, me->buttonDownPos(Qt::RightButton)); |
|
344 |
me2->setButtonDownScreenPos(Qt::LeftButton, me->buttonDownScreenPos(Qt::LeftButton)); |
|
345 |
me2->setButtonDownScreenPos(Qt::RightButton, me->buttonDownScreenPos(Qt::RightButton)); |
|
346 |
me2->setLastPos(me->lastPos()); |
|
347 |
me2->setLastScenePos(me->lastScenePos()); |
|
348 |
me2->setLastScreenPos(me->lastScreenPos()); |
|
349 |
me2->setButtons(me->buttons()); |
|
350 |
me2->setButton(me->button()); |
|
351 |
me2->setModifiers(me->modifiers()); |
|
352 |
return me2; |
|
353 |
} |
|
354 |
||
355 |
case QEvent::GraphicsSceneContextMenu: { |
|
356 |
QGraphicsSceneContextMenuEvent *me = static_cast<QGraphicsSceneContextMenuEvent*>(e); |
|
357 |
QGraphicsSceneContextMenuEvent *me2 = new QGraphicsSceneContextMenuEvent(me->type()); |
|
358 |
me2->setWidget(me->widget()); |
|
359 |
me2->setPos(me->pos()); |
|
360 |
me2->setScenePos(me->scenePos()); |
|
361 |
me2->setScreenPos(me->screenPos()); |
|
362 |
me2->setModifiers(me->modifiers()); |
|
363 |
me2->setReason(me->reason()); |
|
364 |
return me2; |
|
365 |
} |
|
366 |
||
367 |
case QEvent::GraphicsSceneHoverEnter: |
|
368 |
case QEvent::GraphicsSceneHoverMove: |
|
369 |
case QEvent::GraphicsSceneHoverLeave: { |
|
370 |
QGraphicsSceneHoverEvent *he = static_cast<QGraphicsSceneHoverEvent*>(e); |
|
371 |
QGraphicsSceneHoverEvent *he2 = new QGraphicsSceneHoverEvent(he->type()); |
|
372 |
he2->setPos(he->pos()); |
|
373 |
he2->setScenePos(he->scenePos()); |
|
374 |
he2->setScreenPos(he->screenPos()); |
|
375 |
he2->setLastPos(he->lastPos()); |
|
376 |
he2->setLastScenePos(he->lastScenePos()); |
|
377 |
he2->setLastScreenPos(he->lastScreenPos()); |
|
378 |
he2->setModifiers(he->modifiers()); |
|
379 |
return he2; |
|
380 |
} |
|
381 |
case QEvent::GraphicsSceneHelp: |
|
382 |
return new QHelpEvent(*static_cast<QHelpEvent*>(e)); |
|
383 |
case QEvent::GraphicsSceneDragEnter: |
|
384 |
case QEvent::GraphicsSceneDragMove: |
|
385 |
case QEvent::GraphicsSceneDragLeave: |
|
386 |
case QEvent::GraphicsSceneDrop: { |
|
387 |
QGraphicsSceneDragDropEvent *dde = static_cast<QGraphicsSceneDragDropEvent*>(e); |
|
388 |
QGraphicsSceneDragDropEvent *dde2 = new QGraphicsSceneDragDropEvent(dde->type()); |
|
389 |
dde2->setPos(dde->pos()); |
|
390 |
dde2->setScenePos(dde->scenePos()); |
|
391 |
dde2->setScreenPos(dde->screenPos()); |
|
392 |
dde2->setButtons(dde->buttons()); |
|
393 |
dde2->setModifiers(dde->modifiers()); |
|
394 |
return dde2; |
|
395 |
} |
|
396 |
case QEvent::GraphicsSceneWheel: { |
|
397 |
QGraphicsSceneWheelEvent *we = static_cast<QGraphicsSceneWheelEvent*>(e); |
|
398 |
QGraphicsSceneWheelEvent *we2 = new QGraphicsSceneWheelEvent(we->type()); |
|
399 |
we2->setPos(we->pos()); |
|
400 |
we2->setScenePos(we->scenePos()); |
|
401 |
we2->setScreenPos(we->screenPos()); |
|
402 |
we2->setButtons(we->buttons()); |
|
403 |
we2->setModifiers(we->modifiers()); |
|
404 |
we2->setOrientation(we->orientation()); |
|
405 |
return we2; |
|
406 |
} |
|
407 |
#endif |
|
408 |
case QEvent::KeyboardLayoutChange: |
|
409 |
return new QEvent(*e); |
|
410 |
||
411 |
case QEvent::DynamicPropertyChange: |
|
412 |
return new QDynamicPropertyChangeEvent(*static_cast<QDynamicPropertyChangeEvent*>(e)); |
|
413 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
414 |
#ifndef QT_NO_TABLETEVENT |
0 | 415 |
case QEvent::TabletEnterProximity: |
416 |
case QEvent::TabletLeaveProximity: |
|
417 |
return new QTabletEvent(*static_cast<QTabletEvent*>(e)); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
418 |
#endif //QT_NO_TABLETEVENT |
0 | 419 |
|
420 |
case QEvent::NonClientAreaMouseMove: |
|
421 |
case QEvent::NonClientAreaMouseButtonPress: |
|
422 |
case QEvent::NonClientAreaMouseButtonRelease: |
|
423 |
case QEvent::NonClientAreaMouseButtonDblClick: |
|
424 |
return new QMouseEvent(*static_cast<QMouseEvent*>(e)); |
|
425 |
||
426 |
case QEvent::MacSizeChange: |
|
427 |
return new QEvent(*e); |
|
428 |
||
429 |
case QEvent::ContentsRectChange: |
|
430 |
return new QEvent(*e); |
|
431 |
||
432 |
case QEvent::MacGLWindowChange: |
|
433 |
return new QEvent(*e); |
|
434 |
||
435 |
case QEvent::FutureCallOut: |
|
436 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
437 |
break; |
|
438 |
#ifndef QT_NO_GRAPHICSVIEW |
|
439 |
case QEvent::GraphicsSceneResize: { |
|
440 |
QGraphicsSceneResizeEvent *re = static_cast<QGraphicsSceneResizeEvent*>(e); |
|
441 |
QGraphicsSceneResizeEvent *re2 = new QGraphicsSceneResizeEvent(); |
|
442 |
re2->setOldSize(re->oldSize()); |
|
443 |
re2->setNewSize(re->newSize()); |
|
444 |
return re2; |
|
445 |
} |
|
446 |
case QEvent::GraphicsSceneMove: { |
|
447 |
QGraphicsSceneMoveEvent *me = static_cast<QGraphicsSceneMoveEvent*>(e); |
|
448 |
QGraphicsSceneMoveEvent *me2 = new QGraphicsSceneMoveEvent(); |
|
449 |
me2->setWidget(me->widget()); |
|
450 |
me2->setNewPos(me->newPos()); |
|
451 |
me2->setOldPos(me->oldPos()); |
|
452 |
return me2; |
|
453 |
} |
|
454 |
#endif |
|
455 |
case QEvent::CursorChange: |
|
456 |
return new QEvent(*e); |
|
457 |
case QEvent::ToolTipChange: |
|
458 |
return new QEvent(*e); |
|
459 |
||
460 |
case QEvent::NetworkReplyUpdated: |
|
461 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
462 |
break; |
|
463 |
||
464 |
case QEvent::GrabMouse: |
|
465 |
case QEvent::UngrabMouse: |
|
466 |
case QEvent::GrabKeyboard: |
|
467 |
case QEvent::UngrabKeyboard: |
|
468 |
return new QEvent(*e); |
|
469 |
||
470 |
#ifdef QT_MAC_USE_COCOA |
|
471 |
case QEvent::CocoaRequestModal: |
|
472 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
473 |
break; |
|
474 |
#endif |
|
475 |
||
476 |
case QEvent::TouchBegin: |
|
477 |
case QEvent::TouchUpdate: |
|
478 |
case QEvent::TouchEnd: |
|
479 |
return new QTouchEvent(*static_cast<QTouchEvent*>(e)); |
|
480 |
||
481 |
case QEvent::NativeGesture: |
|
482 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
483 |
break; |
|
484 |
||
485 |
case QEvent::RequestSoftwareInputPanel: |
|
486 |
case QEvent::CloseSoftwareInputPanel: |
|
487 |
return new QEvent(*e); |
|
488 |
||
489 |
case QEvent::UpdateSoftKeys: |
|
490 |
return new QEvent(*e); |
|
491 |
||
492 |
case QEvent::User: |
|
493 |
case QEvent::MaxUser: |
|
494 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented"); |
|
495 |
break; |
|
496 |
default: |
|
497 |
; |
|
498 |
} |
|
499 |
return qcoreStateMachineHandler()->cloneEvent(e); |
|
500 |
} |
|
501 |
||
502 |
const QStateMachinePrivate::Handler qt_gui_statemachine_handler = { |
|
503 |
cloneEvent |
|
504 |
}; |
|
505 |
||
506 |
static const QStateMachinePrivate::Handler *qt_guistatemachine_last_handler = 0; |
|
507 |
int qRegisterGuiStateMachine() |
|
508 |
{ |
|
509 |
qt_guistatemachine_last_handler = QStateMachinePrivate::handler; |
|
510 |
QStateMachinePrivate::handler = &qt_gui_statemachine_handler; |
|
511 |
return 1; |
|
512 |
} |
|
513 |
Q_CONSTRUCTOR_FUNCTION(qRegisterGuiStateMachine) |
|
514 |
||
515 |
int qUnregisterGuiStateMachine() |
|
516 |
{ |
|
517 |
QStateMachinePrivate::handler = qt_guistatemachine_last_handler; |
|
518 |
return 1; |
|
519 |
} |
|
520 |
Q_DESTRUCTOR_FUNCTION(qUnregisterGuiStateMachine) |
|
521 |
||
522 |
QT_END_NAMESPACE |
|
523 |
||
524 |
#endif //QT_NO_STATEMACHINE |