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);
|
|
109 |
case QEvent::Wheel:
|
|
110 |
return new QWheelEvent(*static_cast<QWheelEvent*>(e));
|
|
111 |
case QEvent::WindowTitleChange:
|
|
112 |
return new QEvent(*e);
|
|
113 |
case QEvent::WindowIconChange:
|
|
114 |
return new QEvent(*e);
|
|
115 |
case QEvent::ApplicationWindowIconChange:
|
|
116 |
return new QEvent(*e);
|
|
117 |
case QEvent::ApplicationFontChange:
|
|
118 |
return new QEvent(*e);
|
|
119 |
case QEvent::ApplicationLayoutDirectionChange:
|
|
120 |
return new QEvent(*e);
|
|
121 |
case QEvent::ApplicationPaletteChange:
|
|
122 |
return new QEvent(*e);
|
|
123 |
case QEvent::PaletteChange:
|
|
124 |
return new QEvent(*e);
|
|
125 |
case QEvent::Clipboard:
|
|
126 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
127 |
break;
|
|
128 |
case QEvent::Speech:
|
|
129 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
130 |
break;
|
|
131 |
case QEvent::MetaCall:
|
|
132 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
133 |
break;
|
|
134 |
case QEvent::SockAct:
|
|
135 |
return new QEvent(*e);
|
|
136 |
case QEvent::WinEventAct:
|
|
137 |
return new QEvent(*e);
|
|
138 |
case QEvent::DeferredDelete:
|
|
139 |
return new QEvent(*e);
|
|
140 |
#ifndef QT_NO_DRAGANDDROP
|
|
141 |
case QEvent::DragEnter:
|
|
142 |
return new QDragEnterEvent(*static_cast<QDragEnterEvent*>(e));
|
|
143 |
case QEvent::DragMove:
|
|
144 |
return new QDragMoveEvent(*static_cast<QDragMoveEvent*>(e));
|
|
145 |
case QEvent::DragLeave:
|
|
146 |
return new QDragLeaveEvent(*static_cast<QDragLeaveEvent*>(e));
|
|
147 |
case QEvent::Drop:
|
|
148 |
return new QDropEvent(*static_cast<QDragMoveEvent*>(e));
|
|
149 |
case QEvent::DragResponse:
|
|
150 |
return new QDragResponseEvent(*static_cast<QDragResponseEvent*>(e));
|
|
151 |
#endif
|
|
152 |
case QEvent::ChildAdded:
|
|
153 |
return new QChildEvent(*static_cast<QChildEvent*>(e));
|
|
154 |
case QEvent::ChildPolished:
|
|
155 |
return new QChildEvent(*static_cast<QChildEvent*>(e));
|
|
156 |
#ifdef QT3_SUPPORT
|
|
157 |
case QEvent::ChildInsertedRequest:
|
|
158 |
return new QEvent(*e);
|
|
159 |
case QEvent::ChildInserted:
|
|
160 |
return new QChildEvent(*static_cast<QChildEvent*>(e));
|
|
161 |
case QEvent::LayoutHint:
|
|
162 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
163 |
break;
|
|
164 |
#endif
|
|
165 |
case QEvent::ChildRemoved:
|
|
166 |
return new QChildEvent(*static_cast<QChildEvent*>(e));
|
|
167 |
case QEvent::ShowWindowRequest:
|
|
168 |
return new QEvent(*e);
|
|
169 |
case QEvent::PolishRequest:
|
|
170 |
return new QEvent(*e);
|
|
171 |
case QEvent::Polish:
|
|
172 |
return new QEvent(*e);
|
|
173 |
case QEvent::LayoutRequest:
|
|
174 |
return new QEvent(*e);
|
|
175 |
case QEvent::UpdateRequest:
|
|
176 |
return new QEvent(*e);
|
|
177 |
case QEvent::UpdateLater:
|
|
178 |
return new QEvent(*e);
|
|
179 |
|
|
180 |
case QEvent::EmbeddingControl:
|
|
181 |
return new QEvent(*e);
|
|
182 |
case QEvent::ActivateControl:
|
|
183 |
return new QEvent(*e);
|
|
184 |
case QEvent::DeactivateControl:
|
|
185 |
return new QEvent(*e);
|
|
186 |
|
|
187 |
case QEvent::ContextMenu:
|
|
188 |
return new QContextMenuEvent(*static_cast<QContextMenuEvent*>(e));
|
|
189 |
case QEvent::InputMethod:
|
|
190 |
return new QInputMethodEvent(*static_cast<QInputMethodEvent*>(e));
|
|
191 |
case QEvent::AccessibilityPrepare:
|
|
192 |
return new QEvent(*e);
|
|
193 |
case QEvent::TabletMove:
|
|
194 |
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
|
|
195 |
case QEvent::LocaleChange:
|
|
196 |
return new QEvent(*e);
|
|
197 |
case QEvent::LanguageChange:
|
|
198 |
return new QEvent(*e);
|
|
199 |
case QEvent::LayoutDirectionChange:
|
|
200 |
return new QEvent(*e);
|
|
201 |
case QEvent::Style:
|
|
202 |
return new QEvent(*e);
|
|
203 |
case QEvent::TabletPress:
|
|
204 |
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
|
|
205 |
case QEvent::TabletRelease:
|
|
206 |
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
|
|
207 |
case QEvent::OkRequest:
|
|
208 |
return new QEvent(*e);
|
|
209 |
case QEvent::HelpRequest:
|
|
210 |
return new QEvent(*e);
|
|
211 |
|
|
212 |
case QEvent::IconDrag:
|
|
213 |
return new QIconDragEvent(*static_cast<QIconDragEvent*>(e));
|
|
214 |
|
|
215 |
case QEvent::FontChange:
|
|
216 |
return new QEvent(*e);
|
|
217 |
case QEvent::EnabledChange:
|
|
218 |
return new QEvent(*e);
|
|
219 |
case QEvent::ActivationChange:
|
|
220 |
return new QEvent(*e);
|
|
221 |
case QEvent::StyleChange:
|
|
222 |
return new QEvent(*e);
|
|
223 |
case QEvent::IconTextChange:
|
|
224 |
return new QEvent(*e);
|
|
225 |
case QEvent::ModifiedChange:
|
|
226 |
return new QEvent(*e);
|
|
227 |
case QEvent::MouseTrackingChange:
|
|
228 |
return new QEvent(*e);
|
|
229 |
|
|
230 |
case QEvent::WindowBlocked:
|
|
231 |
return new QEvent(*e);
|
|
232 |
case QEvent::WindowUnblocked:
|
|
233 |
return new QEvent(*e);
|
|
234 |
case QEvent::WindowStateChange:
|
|
235 |
return new QWindowStateChangeEvent(*static_cast<QWindowStateChangeEvent*>(e));
|
|
236 |
|
|
237 |
case QEvent::ToolTip:
|
|
238 |
return new QHelpEvent(*static_cast<QHelpEvent*>(e));
|
|
239 |
case QEvent::WhatsThis:
|
|
240 |
return new QHelpEvent(*static_cast<QHelpEvent*>(e));
|
|
241 |
case QEvent::StatusTip:
|
|
242 |
return new QStatusTipEvent(*static_cast<QStatusTipEvent*>(e));
|
|
243 |
#ifndef QT_NO_ACTION
|
|
244 |
case QEvent::ActionChanged:
|
|
245 |
case QEvent::ActionAdded:
|
|
246 |
case QEvent::ActionRemoved:
|
|
247 |
return new QActionEvent(*static_cast<QActionEvent*>(e));
|
|
248 |
#endif
|
|
249 |
case QEvent::FileOpen:
|
|
250 |
return new QFileOpenEvent(*static_cast<QFileOpenEvent*>(e));
|
|
251 |
|
|
252 |
case QEvent::Shortcut:
|
|
253 |
return new QShortcutEvent(*static_cast<QShortcutEvent*>(e));
|
|
254 |
case QEvent::ShortcutOverride:
|
|
255 |
return new QKeyEvent(*static_cast<QKeyEvent*>(e));
|
|
256 |
|
|
257 |
#ifdef QT3_SUPPORT
|
|
258 |
case QEvent::Accel:
|
|
259 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
260 |
break;
|
|
261 |
case QEvent::AccelAvailable:
|
|
262 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
263 |
break;
|
|
264 |
#endif
|
|
265 |
|
|
266 |
case QEvent::WhatsThisClicked:
|
|
267 |
return new QWhatsThisClickedEvent(*static_cast<QWhatsThisClickedEvent*>(e));
|
|
268 |
|
|
269 |
case QEvent::ToolBarChange:
|
|
270 |
return new QToolBarChangeEvent(*static_cast<QToolBarChangeEvent*>(e));
|
|
271 |
|
|
272 |
case QEvent::ApplicationActivate:
|
|
273 |
return new QEvent(*e);
|
|
274 |
case QEvent::ApplicationDeactivate:
|
|
275 |
return new QEvent(*e);
|
|
276 |
|
|
277 |
case QEvent::QueryWhatsThis:
|
|
278 |
return new QHelpEvent(*static_cast<QHelpEvent*>(e));
|
|
279 |
case QEvent::EnterWhatsThisMode:
|
|
280 |
return new QEvent(*e);
|
|
281 |
case QEvent::LeaveWhatsThisMode:
|
|
282 |
return new QEvent(*e);
|
|
283 |
|
|
284 |
case QEvent::ZOrderChange:
|
|
285 |
return new QEvent(*e);
|
|
286 |
|
|
287 |
case QEvent::HoverEnter:
|
|
288 |
case QEvent::HoverLeave:
|
|
289 |
case QEvent::HoverMove:
|
|
290 |
return new QHoverEvent(*static_cast<QHoverEvent*>(e));
|
|
291 |
|
|
292 |
case QEvent::AccessibilityHelp:
|
|
293 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
294 |
break;
|
|
295 |
case QEvent::AccessibilityDescription:
|
|
296 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
297 |
break;
|
|
298 |
|
|
299 |
#ifdef QT_KEYPAD_NAVIGATION
|
|
300 |
case QEvent::EnterEditFocus:
|
|
301 |
return new QEvent(*e);
|
|
302 |
case QEvent::LeaveEditFocus:
|
|
303 |
return new QEvent(*e);
|
|
304 |
#endif
|
|
305 |
case QEvent::AcceptDropsChange:
|
|
306 |
return new QEvent(*e);
|
|
307 |
|
|
308 |
#ifdef QT3_SUPPORT
|
|
309 |
case QEvent::MenubarUpdated:
|
|
310 |
return new QMenubarUpdatedEvent(*static_cast<QMenubarUpdatedEvent*>(e));
|
|
311 |
#endif
|
|
312 |
|
|
313 |
case QEvent::ZeroTimerEvent:
|
|
314 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
315 |
break;
|
|
316 |
#ifndef QT_NO_GRAPHICSVIEW
|
|
317 |
case QEvent::GraphicsSceneMouseMove:
|
|
318 |
case QEvent::GraphicsSceneMousePress:
|
|
319 |
case QEvent::GraphicsSceneMouseRelease:
|
|
320 |
case QEvent::GraphicsSceneMouseDoubleClick: {
|
|
321 |
QGraphicsSceneMouseEvent *me = static_cast<QGraphicsSceneMouseEvent*>(e);
|
|
322 |
QGraphicsSceneMouseEvent *me2 = new QGraphicsSceneMouseEvent(me->type());
|
|
323 |
me2->setWidget(me->widget());
|
|
324 |
me2->setPos(me->pos());
|
|
325 |
me2->setScenePos(me->scenePos());
|
|
326 |
me2->setScreenPos(me->screenPos());
|
|
327 |
// ### for all buttons
|
|
328 |
me2->setButtonDownPos(Qt::LeftButton, me->buttonDownPos(Qt::LeftButton));
|
|
329 |
me2->setButtonDownPos(Qt::RightButton, me->buttonDownPos(Qt::RightButton));
|
|
330 |
me2->setButtonDownScreenPos(Qt::LeftButton, me->buttonDownScreenPos(Qt::LeftButton));
|
|
331 |
me2->setButtonDownScreenPos(Qt::RightButton, me->buttonDownScreenPos(Qt::RightButton));
|
|
332 |
me2->setLastPos(me->lastPos());
|
|
333 |
me2->setLastScenePos(me->lastScenePos());
|
|
334 |
me2->setLastScreenPos(me->lastScreenPos());
|
|
335 |
me2->setButtons(me->buttons());
|
|
336 |
me2->setButton(me->button());
|
|
337 |
me2->setModifiers(me->modifiers());
|
|
338 |
return me2;
|
|
339 |
}
|
|
340 |
|
|
341 |
case QEvent::GraphicsSceneContextMenu: {
|
|
342 |
QGraphicsSceneContextMenuEvent *me = static_cast<QGraphicsSceneContextMenuEvent*>(e);
|
|
343 |
QGraphicsSceneContextMenuEvent *me2 = new QGraphicsSceneContextMenuEvent(me->type());
|
|
344 |
me2->setWidget(me->widget());
|
|
345 |
me2->setPos(me->pos());
|
|
346 |
me2->setScenePos(me->scenePos());
|
|
347 |
me2->setScreenPos(me->screenPos());
|
|
348 |
me2->setModifiers(me->modifiers());
|
|
349 |
me2->setReason(me->reason());
|
|
350 |
return me2;
|
|
351 |
}
|
|
352 |
|
|
353 |
case QEvent::GraphicsSceneHoverEnter:
|
|
354 |
case QEvent::GraphicsSceneHoverMove:
|
|
355 |
case QEvent::GraphicsSceneHoverLeave: {
|
|
356 |
QGraphicsSceneHoverEvent *he = static_cast<QGraphicsSceneHoverEvent*>(e);
|
|
357 |
QGraphicsSceneHoverEvent *he2 = new QGraphicsSceneHoverEvent(he->type());
|
|
358 |
he2->setPos(he->pos());
|
|
359 |
he2->setScenePos(he->scenePos());
|
|
360 |
he2->setScreenPos(he->screenPos());
|
|
361 |
he2->setLastPos(he->lastPos());
|
|
362 |
he2->setLastScenePos(he->lastScenePos());
|
|
363 |
he2->setLastScreenPos(he->lastScreenPos());
|
|
364 |
he2->setModifiers(he->modifiers());
|
|
365 |
return he2;
|
|
366 |
}
|
|
367 |
case QEvent::GraphicsSceneHelp:
|
|
368 |
return new QHelpEvent(*static_cast<QHelpEvent*>(e));
|
|
369 |
case QEvent::GraphicsSceneDragEnter:
|
|
370 |
case QEvent::GraphicsSceneDragMove:
|
|
371 |
case QEvent::GraphicsSceneDragLeave:
|
|
372 |
case QEvent::GraphicsSceneDrop: {
|
|
373 |
QGraphicsSceneDragDropEvent *dde = static_cast<QGraphicsSceneDragDropEvent*>(e);
|
|
374 |
QGraphicsSceneDragDropEvent *dde2 = new QGraphicsSceneDragDropEvent(dde->type());
|
|
375 |
dde2->setPos(dde->pos());
|
|
376 |
dde2->setScenePos(dde->scenePos());
|
|
377 |
dde2->setScreenPos(dde->screenPos());
|
|
378 |
dde2->setButtons(dde->buttons());
|
|
379 |
dde2->setModifiers(dde->modifiers());
|
|
380 |
return dde2;
|
|
381 |
}
|
|
382 |
case QEvent::GraphicsSceneWheel: {
|
|
383 |
QGraphicsSceneWheelEvent *we = static_cast<QGraphicsSceneWheelEvent*>(e);
|
|
384 |
QGraphicsSceneWheelEvent *we2 = new QGraphicsSceneWheelEvent(we->type());
|
|
385 |
we2->setPos(we->pos());
|
|
386 |
we2->setScenePos(we->scenePos());
|
|
387 |
we2->setScreenPos(we->screenPos());
|
|
388 |
we2->setButtons(we->buttons());
|
|
389 |
we2->setModifiers(we->modifiers());
|
|
390 |
we2->setOrientation(we->orientation());
|
|
391 |
return we2;
|
|
392 |
}
|
|
393 |
#endif
|
|
394 |
case QEvent::KeyboardLayoutChange:
|
|
395 |
return new QEvent(*e);
|
|
396 |
|
|
397 |
case QEvent::DynamicPropertyChange:
|
|
398 |
return new QDynamicPropertyChangeEvent(*static_cast<QDynamicPropertyChangeEvent*>(e));
|
|
399 |
|
|
400 |
case QEvent::TabletEnterProximity:
|
|
401 |
case QEvent::TabletLeaveProximity:
|
|
402 |
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
|
|
403 |
|
|
404 |
case QEvent::NonClientAreaMouseMove:
|
|
405 |
case QEvent::NonClientAreaMouseButtonPress:
|
|
406 |
case QEvent::NonClientAreaMouseButtonRelease:
|
|
407 |
case QEvent::NonClientAreaMouseButtonDblClick:
|
|
408 |
return new QMouseEvent(*static_cast<QMouseEvent*>(e));
|
|
409 |
|
|
410 |
case QEvent::MacSizeChange:
|
|
411 |
return new QEvent(*e);
|
|
412 |
|
|
413 |
case QEvent::ContentsRectChange:
|
|
414 |
return new QEvent(*e);
|
|
415 |
|
|
416 |
case QEvent::MacGLWindowChange:
|
|
417 |
return new QEvent(*e);
|
|
418 |
|
|
419 |
case QEvent::FutureCallOut:
|
|
420 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
421 |
break;
|
|
422 |
#ifndef QT_NO_GRAPHICSVIEW
|
|
423 |
case QEvent::GraphicsSceneResize: {
|
|
424 |
QGraphicsSceneResizeEvent *re = static_cast<QGraphicsSceneResizeEvent*>(e);
|
|
425 |
QGraphicsSceneResizeEvent *re2 = new QGraphicsSceneResizeEvent();
|
|
426 |
re2->setOldSize(re->oldSize());
|
|
427 |
re2->setNewSize(re->newSize());
|
|
428 |
return re2;
|
|
429 |
}
|
|
430 |
case QEvent::GraphicsSceneMove: {
|
|
431 |
QGraphicsSceneMoveEvent *me = static_cast<QGraphicsSceneMoveEvent*>(e);
|
|
432 |
QGraphicsSceneMoveEvent *me2 = new QGraphicsSceneMoveEvent();
|
|
433 |
me2->setWidget(me->widget());
|
|
434 |
me2->setNewPos(me->newPos());
|
|
435 |
me2->setOldPos(me->oldPos());
|
|
436 |
return me2;
|
|
437 |
}
|
|
438 |
#endif
|
|
439 |
case QEvent::CursorChange:
|
|
440 |
return new QEvent(*e);
|
|
441 |
case QEvent::ToolTipChange:
|
|
442 |
return new QEvent(*e);
|
|
443 |
|
|
444 |
case QEvent::NetworkReplyUpdated:
|
|
445 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
446 |
break;
|
|
447 |
|
|
448 |
case QEvent::GrabMouse:
|
|
449 |
case QEvent::UngrabMouse:
|
|
450 |
case QEvent::GrabKeyboard:
|
|
451 |
case QEvent::UngrabKeyboard:
|
|
452 |
return new QEvent(*e);
|
|
453 |
|
|
454 |
#ifdef QT_MAC_USE_COCOA
|
|
455 |
case QEvent::CocoaRequestModal:
|
|
456 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
457 |
break;
|
|
458 |
#endif
|
|
459 |
|
|
460 |
case QEvent::TouchBegin:
|
|
461 |
case QEvent::TouchUpdate:
|
|
462 |
case QEvent::TouchEnd:
|
|
463 |
return new QTouchEvent(*static_cast<QTouchEvent*>(e));
|
|
464 |
|
|
465 |
case QEvent::NativeGesture:
|
|
466 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
467 |
break;
|
|
468 |
|
|
469 |
case QEvent::RequestSoftwareInputPanel:
|
|
470 |
case QEvent::CloseSoftwareInputPanel:
|
|
471 |
return new QEvent(*e);
|
|
472 |
|
|
473 |
case QEvent::UpdateSoftKeys:
|
|
474 |
return new QEvent(*e);
|
|
475 |
|
|
476 |
case QEvent::User:
|
|
477 |
case QEvent::MaxUser:
|
|
478 |
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
|
|
479 |
break;
|
|
480 |
default:
|
|
481 |
;
|
|
482 |
}
|
|
483 |
return qcoreStateMachineHandler()->cloneEvent(e);
|
|
484 |
}
|
|
485 |
|
|
486 |
const QStateMachinePrivate::Handler qt_gui_statemachine_handler = {
|
|
487 |
cloneEvent
|
|
488 |
};
|
|
489 |
|
|
490 |
static const QStateMachinePrivate::Handler *qt_guistatemachine_last_handler = 0;
|
|
491 |
int qRegisterGuiStateMachine()
|
|
492 |
{
|
|
493 |
qt_guistatemachine_last_handler = QStateMachinePrivate::handler;
|
|
494 |
QStateMachinePrivate::handler = &qt_gui_statemachine_handler;
|
|
495 |
return 1;
|
|
496 |
}
|
|
497 |
Q_CONSTRUCTOR_FUNCTION(qRegisterGuiStateMachine)
|
|
498 |
|
|
499 |
int qUnregisterGuiStateMachine()
|
|
500 |
{
|
|
501 |
QStateMachinePrivate::handler = qt_guistatemachine_last_handler;
|
|
502 |
return 1;
|
|
503 |
}
|
|
504 |
Q_DESTRUCTOR_FUNCTION(qUnregisterGuiStateMachine)
|
|
505 |
|
|
506 |
QT_END_NAMESPACE
|
|
507 |
|
|
508 |
#endif //QT_NO_STATEMACHINE
|