KHtml

kqeventutil.cpp
1 // -*- c++ -*-
2 /* This file is part of the KDE project
3  *
4  * Copyright (C) 2000 Wynn Wilkes <[email protected]>
5  * 2002 Till Krech <[email protected]>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 #include "kqeventutil.h"
23 #include <QKeyEvent>
24 
25 QString KQEventUtil::getQtEventName(QEvent *e)
26 {
27  QString s;
28 
29  switch (e->type()) {
30  case QEvent::None:
31  s = "None";
32  break;
33  case QEvent::Timer:
34  s = "Timer";
35  break;
37  s = "MouseButtonPress";
38  break;
40  s = "MouseButtonRelease";
41  break;
43  s = "MouseButtonClick";
44  break;
45  case QEvent::MouseMove:
46  s = "MouseMove";
47  break;
48  case QEvent::KeyPress:
49  s = "KeyPress";
50  break;
51  case QEvent::KeyRelease:
52  s = "KeyRelease";
53  break;
54  case QEvent::FocusIn:
55  s = "FocusIn";
56  break;
57  case QEvent::FocusOut:
58  s = "FocusOut";
59  break;
60  case QEvent::Enter:
61  s = "Enter";
62  break;
63  case QEvent::Leave:
64  s = "Leave";
65  break;
66  case QEvent::Paint:
67  s = "Paint";
68  break;
69  case QEvent::Move:
70  s = "Move";
71  break;
72  case QEvent::Resize:
73  s = "Resize";
74  break;
75  case QEvent::Create:
76  s = "Create";
77  break;
78  case QEvent::Destroy:
79  s = "Destroy";
80  break;
81  case QEvent::Show:
82  s = "Show";
83  break;
84  case QEvent::Hide:
85  s = "Hide";
86  break;
87  case QEvent::Close:
88  s = "Close";
89  break;
90  case QEvent::Quit:
91  s = "Quit";
92  break;
93  case QEvent::Reparent:
94  s = "Reparent";
95  break;
96  case QEvent::ShowMinimized:
97  s = "ShowMinimized";
98  break;
99  case QEvent::ShowNormal:
100  s = "ShowNormal";
101  break;
103  s = "WindowActivate";
104  break;
106  s = "WindowDeactivate";
107  break;
109  s = "ShowToParent";
110  break;
112  s = "HideToParent";
113  break;
114  case QEvent::ShowMaximized:
115  s = "ShowMaximized";
116  break;
117  case QEvent::Accel:
118  s = "Accel";
119  break;
120  case QEvent::Wheel:
121  s = "Wheel";
122  break;
123  case QEvent::AccelAvailable:
124  s = "AccelAvailable";
125  break;
127  s = "CaptionChange";
128  break;
130  s = "IconChange";
131  break;
132  case QEvent::ParentFontChange:
133  s = "ParentFontChange";
134  break;
136  s = "ApplicationFontChange";
137  break;
138  case QEvent::ParentPaletteChange:
139  s = "ParentPaletteChange";
140  break;
142  s = "ApplicationPaletteChange";
143  break;
144  case QEvent::Clipboard:
145  s = "Clipboard";
146  break;
147  case QEvent::Speech:
148  s = "Speech";
149  break;
150  case QEvent::SockAct:
151  s = "SockAct";
152  break;
154  s = "AccelOverride";
155  break;
156  case QEvent::DragEnter:
157  s = "DragEnter";
158  break;
159  case QEvent::DragMove:
160  s = "DragMove";
161  break;
162  case QEvent::DragLeave:
163  s = "DragLeave";
164  break;
165  case QEvent::Drop:
166  s = "Drop";
167  break;
169  s = "DragResponse";
170  break;
171  case QEvent::ChildInserted:
172  s = "ChildInserted";
173  break;
175  s = "ChildRemoved";
176  break;
177  case QEvent::LayoutHint:
178  s = "LayoutHint";
179  break;
181  s = "ShowWindowRequest";
182  break;
184  s = "ActivateControl";
185  break;
187  s = "DeactivateControl";
188  break;
189  case QEvent::User:
190  s = "User Event";
191  break;
192 
193  default:
194  s = "Undefined Event, value = " + QString::number(e->type());
195  break;
196  }
197 
198  return s;
199 }
QEvent::Type type() const const
QString number(int n, int base)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:47:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.