QT自定义事件类型

Constant

Value

Description
</tr>

QEvent::None

0

Not an event.
</tr>

QEvent::ActionAdded

114

A new action has been added ([QActionEvent](http://qt-project.org/doc/qt-5.1/qtgui/qactionevent.html)).
</tr>

QEvent::ActionChanged

113

An action has been changed ([QActionEvent](http://qt-project.org/doc/qt-5.1/qtgui/qactionevent.html)).
</tr>

QEvent::ActionRemoved

115

An action has been removed ([QActionEvent](http://qt-project.org/doc/qt-5.1/qtgui/qactionevent.html)).
</tr>

QEvent::ActivationChange

99

A widget's top-level window activation state has changed.
</tr>

QEvent::ApplicationActivate

121

This enum has been deprecated. Use ApplicationStateChange instead.
</tr>

QEvent::ApplicationActivated

ApplicationActivate

This enum has been deprecated. Use ApplicationStateChange instead.
</tr>

QEvent::ApplicationDeactivate

122

This enum has been deprecated. Use ApplicationStateChange instead.
</tr>

QEvent::ApplicationFontChange

36

The default application font has changed.
</tr>

QEvent::ApplicationLayoutDirectionChange

37

The default application layout direction has changed.
</tr>

QEvent::ApplicationPaletteChange

38

The default application palette has changed.
</tr>

QEvent::ApplicationStateChange

214

The state of the application has changed.
</tr>

QEvent::ApplicationWindowIconChange

35

The application's icon has changed.
</tr>

QEvent::ChildAdded

68

An object gets a child ([QChildEvent](http://qt-project.org/doc/qt-5.1/qtcore/qchildevent.html)).
</tr>

QEvent::ChildPolished

69

A widget child gets polished ([QChildEvent](http://qt-project.org/doc/qt-5.1/qtcore/qchildevent.html)).
</tr>

QEvent::ChildRemoved

71

An object loses a child ([QChildEvent](http://qt-project.org/doc/qt-5.1/qtcore/qchildevent.html)).
</tr>

QEvent::Clipboard

40

The clipboard contents have changed (QClipboardEvent).
</tr>

QEvent::Close

19

Widget was closed ([QCloseEvent](http://qt-project.org/doc/qt-5.1/qtgui/qcloseevent.html)).
</tr>

QEvent::CloseSoftwareInputPanel

200

A widget wants to close the software input panel (SIP).
</tr>

QEvent::ContentsRectChange

178

The margins of the widget's content rect changed.
</tr>

QEvent::ContextMenu

82

Context popup menu ([QContextMenuEvent](http://qt-project.org/doc/qt-5.1/qtgui/qcontextmenuevent.html)).
</tr>

QEvent::CursorChange

183

The widget's cursor has changed.
</tr>

QEvent::DeferredDelete

52

The object will be deleted after it has cleaned up (QDeferredDeleteEvent).
</tr>

QEvent::DragEnter

60

The cursor enters a widget during a drag and drop operation ([QDragEnterEvent](http://qt-project.org/doc/qt-5.1/qtgui/qdragenterevent.html)).
</tr>

QEvent::DragLeave

62

The cursor leaves a widget during a drag and drop operation ([QDragLeaveEvent](http://qt-project.org/doc/qt-5.1/qtgui/qdragleaveevent.html)).
</tr>

QEvent::DragMove

61

A drag and drop operation is in progress ([QDragMoveEvent](http://qt-project.org/doc/qt-5.1/qtgui/qdragmoveevent.html)).
</tr>

QEvent::Drop

63

A drag and drop operation is completed ([QDropEvent](http://qt-project.org/doc/qt-5.1/qtgui/qdropevent.html)).
</tr>

QEvent::DynamicPropertyChange

170

A dynamic property was added, changed, or removed from the object.
</tr>

QEvent::EnabledChange

98

Widget's enabled state has changed.
</tr>

QEvent::Enter

10

Mouse enters widget's boundaries ([QEnterEvent](http://qt-project.org/doc/qt-5.1/qtgui/qenterevent.html)).
</tr>

QEvent::EnterEditFocus

150

An editor widget gains focus for editing. QT_KEYPAD_NAVIGATION must be defined.
</tr>

QEvent::EnterWhatsThisMode

124

Send to toplevel widgets when the application enters "What's This?" mode.
</tr>

QEvent::Expose

206

Sent to a window when its on-screen contents are invalidated and need to be flushed from the backing store.
</tr>

QEvent::FileOpen

116

File open request ([QFileOpenEvent](http://qt-project.org/doc/qt-5.1/qtgui/qfileopenevent.html)).
</tr>

QEvent::FocusIn

8

Widget or Window gains keyboard focus ([QFocusEvent](http://qt-project.org/doc/qt-5.1/qtgui/qfocusevent.html)).
</tr>

QEvent::FocusOut

9

Widget or Window loses keyboard focus ([QFocusEvent](http://qt-project.org/doc/qt-5.1/qtgui/qfocusevent.html)).
</tr>

QEvent::FocusAboutToChange

23

Widget or Window focus is about to change ([QFocusEvent](http://qt-project.org/doc/qt-5.1/qtgui/qfocusevent.html))
</tr>

QEvent::FontChange

97

Widget's font has changed.
</tr>

QEvent::Gesture

198

A gesture was triggered ([QGestureEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgestureevent.html)).
</tr>

QEvent::GestureOverride

202

A gesture override was triggered ([QGestureEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgestureevent.html)).
</tr>

QEvent::GrabKeyboard

188

Item gains keyboard grab ([QGraphicsItem](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsitem.html) only).
</tr>

QEvent::GrabMouse

186

Item gains mouse grab ([QGraphicsItem](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsitem.html) only).
</tr>

QEvent::GraphicsSceneContextMenu

159

Context popup menu over a graphics scene ([QGraphicsSceneContextMenuEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenecontextmenuevent.html)).
</tr>

QEvent::GraphicsSceneDragEnter

164

The cursor enters a graphics scene during a drag and drop operation ([QGraphicsSceneDragDropEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenedragdropevent.html)).
</tr>

QEvent::GraphicsSceneDragLeave

166

The cursor leaves a graphics scene during a drag and drop operation ([QGraphicsSceneDragDropEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenedragdropevent.html)).
</tr>

QEvent::GraphicsSceneDragMove

165

A drag and drop operation is in progress over a scene ([QGraphicsSceneDragDropEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenedragdropevent.html)).
</tr>

QEvent::GraphicsSceneDrop

167

A drag and drop operation is completed over a scene ([QGraphicsSceneDragDropEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenedragdropevent.html)).
</tr>

QEvent::GraphicsSceneHelp

163

The user requests help for a graphics scene ([QHelpEvent](http://qt-project.org/doc/qt-5.1/qtgui/qhelpevent.html)).
</tr>

QEvent::GraphicsSceneHoverEnter

160

The mouse cursor enters a hover item in a graphics scene ([QGraphicsSceneHoverEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenehoverevent.html)).
</tr>

QEvent::GraphicsSceneHoverLeave

162

The mouse cursor leaves a hover item in a graphics scene ([QGraphicsSceneHoverEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenehoverevent.html)).
</tr>

QEvent::GraphicsSceneHoverMove

161

The mouse cursor moves inside a hover item in a graphics scene ([QGraphicsSceneHoverEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenehoverevent.html)).
</tr>

QEvent::GraphicsSceneMouseDoubleClick

158

Mouse press again (double click) in a graphics scene ([QGraphicsSceneMouseEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenemouseevent.html)).
</tr>

QEvent::GraphicsSceneMouseMove

155

Move mouse in a graphics scene ([QGraphicsSceneMouseEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenemouseevent.html)).
</tr>

QEvent::GraphicsSceneMousePress

156

Mouse press in a graphics scene ([QGraphicsSceneMouseEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenemouseevent.html)).
</tr>

QEvent::GraphicsSceneMouseRelease

157

Mouse release in a graphics scene ([QGraphicsSceneMouseEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenemouseevent.html)).
</tr>

QEvent::GraphicsSceneMove

182

Widget was moved ([QGraphicsSceneMoveEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenemoveevent.html)).
</tr>

QEvent::GraphicsSceneResize

181

Widget was resized ([QGraphicsSceneResizeEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicssceneresizeevent.html)).
</tr>

QEvent::GraphicsSceneWheel

168

Mouse wheel rolled in a graphics scene ([QGraphicsSceneWheelEvent](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsscenewheelevent.html)).
</tr>

QEvent::Hide

18

Widget was hidden ([QHideEvent](http://qt-project.org/doc/qt-5.1/qtgui/qhideevent.html)).
</tr>

QEvent::HideToParent

27

A child widget has been hidden.
</tr>

QEvent::HoverEnter

127

The mouse cursor enters a hover widget ([QHoverEvent](http://qt-project.org/doc/qt-5.1/qtgui/qhoverevent.html)).
</tr>

QEvent::HoverLeave

128

The mouse cursor leaves a hover widget ([QHoverEvent](http://qt-project.org/doc/qt-5.1/qtgui/qhoverevent.html)).
</tr>

QEvent::HoverMove

129

The mouse cursor moves inside a hover widget ([QHoverEvent](http://qt-project.org/doc/qt-5.1/qtgui/qhoverevent.html)).
</tr>

QEvent::IconDrag

96

The main icon of a window has been dragged away ([QIconDragEvent](http://qt-project.org/doc/qt-5.1/qtgui/qicondragevent.html)).
</tr>

QEvent::IconTextChange

101

Widget's icon text has been changed.
</tr>

QEvent::InputMethod

83

An input method is being used ([QInputMethodEvent](http://qt-project.org/doc/qt-5.1/qtgui/qinputmethodevent.html)).
</tr>

QEvent::InputMethodQuery

207

A input method query event ([QInputMethodQueryEvent](http://qt-project.org/doc/qt-5.1/qtgui/qinputmethodqueryevent.html))
</tr>

QEvent::KeyboardLayoutChange

169

The keyboard layout has changed.
</tr>

QEvent::KeyPress

6

Key press ([QKeyEvent](http://qt-project.org/doc/qt-5.1/qtgui/qkeyevent.html)).
</tr>

QEvent::KeyRelease

7

Key release ([QKeyEvent](http://qt-project.org/doc/qt-5.1/qtgui/qkeyevent.html)).
</tr>

QEvent::LanguageChange

89

The application translation changed.
</tr>

QEvent::LayoutDirectionChange

90

The direction of layouts changed.
</tr>

QEvent::LayoutRequest

76

Widget layout needs to be redone.
</tr>

QEvent::Leave

11

Mouse leaves widget's boundaries.
</tr>

QEvent::LeaveEditFocus

151

An editor widget loses focus for editing. QT_KEYPAD_NAVIGATION must be defined.
</tr>

QEvent::LeaveWhatsThisMode

125

Send to toplevel widgets when the application leaves "What's This?" mode.
</tr>

QEvent::LocaleChange

88

The system locale has changed.
</tr>

QEvent::NonClientAreaMouseButtonDblClick

176

A mouse double click occurred outside the client area.
</tr>

QEvent::NonClientAreaMouseButtonPress

174

A mouse button press occurred outside the client area.
</tr>

QEvent::NonClientAreaMouseButtonRelease

175

A mouse button release occurred outside the client area.
</tr>

QEvent::NonClientAreaMouseMove

173

A mouse move occurred outside the client area.
</tr>

QEvent::MacSizeChange

177

The user changed his widget sizes (Mac OS X only).
</tr>

QEvent::MetaCall

43

An asynchronous method invocation via[QMetaObject::invokeMethod](http://qt-project.org/doc/qt-5.1/qtcore/qmetaobject.html#invokeMethod)().
</tr>

QEvent::ModifiedChange

102

Widgets modification state has been changed.
</tr>

QEvent::MouseButtonDblClick

4

Mouse press again ([QMouseEvent](http://qt-project.org/doc/qt-5.1/qtgui/qmouseevent.html)).
</tr>

QEvent::MouseButtonPress

2

Mouse press ([QMouseEvent](http://qt-project.org/doc/qt-5.1/qtgui/qmouseevent.html)).
</tr>

QEvent::MouseButtonRelease

3

Mouse release ([QMouseEvent](http://qt-project.org/doc/qt-5.1/qtgui/qmouseevent.html)).
</tr>

QEvent::MouseMove

5

Mouse move ([QMouseEvent](http://qt-project.org/doc/qt-5.1/qtgui/qmouseevent.html)).
</tr>

QEvent::MouseTrackingChange

109

The mouse tracking state has changed.
</tr>

QEvent::Move

13

Widget's position changed ([QMoveEvent](http://qt-project.org/doc/qt-5.1/qtgui/qmoveevent.html)).
</tr>

QEvent::OrientationChange

208

The screens orientation has changes (QScreenOrientationChangeEvent)
</tr>

QEvent::Paint

12

Screen update necessary ([QPaintEvent](http://qt-project.org/doc/qt-5.1/qtgui/qpaintevent.html)).
</tr>

QEvent::PaletteChange

39

Palette of the widget changed.
</tr>

QEvent::ParentAboutToChange

131

The widget parent is about to change.
</tr>

QEvent::ParentChange

21

The widget parent has changed.
</tr>

QEvent::PlatformPanel

212

A platform specific panel has been requested.
</tr>

QEvent::Polish

75

The widget is polished.
</tr>

QEvent::PolishRequest

74

The widget should be polished.
</tr>

QEvent::QueryWhatsThis

123

The widget should accept the event if it has "What's This?" help.
</tr>

QEvent::RequestSoftwareInputPanel

199

A widget wants to open a software input panel (SIP).
</tr>

QEvent::Resize

14

Widget's size changed ([QResizeEvent](http://qt-project.org/doc/qt-5.1/qtgui/qresizeevent.html)).
</tr>

QEvent::ScrollPrepare

204

The object needs to fill in its geometry information ([QScrollPrepareEvent](http://qt-project.org/doc/qt-5.1/qtgui/qscrollprepareevent.html)).
</tr>

QEvent::Scroll

205

The object needs to scroll to the supplied position ([QScrollEvent](http://qt-project.org/doc/qt-5.1/qtgui/qscrollevent.html)).
</tr>

QEvent::Shortcut

117

Key press in child for shortcut key handling ([QShortcutEvent](http://qt-project.org/doc/qt-5.1/qtgui/qshortcutevent.html)).
</tr>

QEvent::ShortcutOverride

51

Key press in child, for overriding shortcut key handling ([QKeyEvent](http://qt-project.org/doc/qt-5.1/qtgui/qkeyevent.html)).
</tr>

QEvent::Show

17

Widget was shown on screen ([QShowEvent](http://qt-project.org/doc/qt-5.1/qtgui/qshowevent.html)).
</tr>

QEvent::ShowToParent

26

A child widget has been shown.
</tr>

QEvent::SockAct

50

Socket activated, used to implement[QSocketNotifier](http://qt-project.org/doc/qt-5.1/qtcore/qsocketnotifier.html).
</tr>

QEvent::StateMachineSignal

192

A signal delivered to a state machine ([QStateMachine::SignalEvent](http://qt-project.org/doc/qt-5.1/qtcore/qstatemachine-signalevent.html)).
</tr>

QEvent::StateMachineWrapped

193

The event is a wrapper for, i.e., contains, another event ([QStateMachine::WrappedEvent](http://qt-project.org/doc/qt-5.1/qtcore/qstatemachine-wrappedevent.html)).
</tr>

QEvent::StatusTip

112

A status tip is requested ([QStatusTipEvent](http://qt-project.org/doc/qt-5.1/qtgui/qstatustipevent.html)).
</tr>

QEvent::StyleChange

100

Widget's style has been changed.
</tr>

QEvent::TabletMove

87

Wacom tablet move ([QTabletEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtabletevent.html)).
</tr>

QEvent::TabletPress

92

Wacom tablet press ([QTabletEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtabletevent.html)).
</tr>

QEvent::TabletRelease

93

Wacom tablet release ([QTabletEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtabletevent.html)).
</tr>

QEvent::OkRequest

94

Ok button in decoration pressed. Supported only for Windows CE.
</tr>

QEvent::TabletEnterProximity

171

Wacom tablet enter proximity event ([QTabletEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtabletevent.html)), sent to [QApplication](http://qt-project.org/doc/qt-5.1/qtwidgets/qapplication.html).
</tr>

QEvent::TabletLeaveProximity

172

Wacom tablet leave proximity event ([QTabletEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtabletevent.html)), sent to [QApplication](http://qt-project.org/doc/qt-5.1/qtwidgets/qapplication.html).
</tr>

QEvent::ThreadChange

22

The object is moved to another thread. This is the last event sent to this object in the previous thread. See [QObject::moveToThread](http://qt-project.org/doc/qt-5.1/qtcore/qobject.html#moveToThread)().
</tr>

QEvent::Timer

1

Regular timer events ([QTimerEvent](http://qt-project.org/doc/qt-5.1/qtcore/qtimerevent.html)).
</tr>

QEvent::ToolBarChange

120

The toolbar button is toggled on Mac OS X.
</tr>

QEvent::ToolTip

110

A tooltip was requested ([QHelpEvent](http://qt-project.org/doc/qt-5.1/qtgui/qhelpevent.html)).
</tr>

QEvent::ToolTipChange

184

The widget's tooltip has changed.
</tr>

QEvent::TouchBegin

194

Beginning of a sequence of touch-screen or track-pad events ([QTouchEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtouchevent.html)).
</tr>

QEvent::TouchCancel

209

Cancellation of touch-event sequence ([QTouchEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtouchevent.html)).
</tr>

QEvent::TouchEnd

196

End of touch-event sequence ([QTouchEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtouchevent.html)).
</tr>

QEvent::TouchUpdate

195

Touch-screen event ([QTouchEvent](http://qt-project.org/doc/qt-5.1/qtgui/qtouchevent.html)).
</tr>

QEvent::UngrabKeyboard

189

Item loses keyboard grab ([QGraphicsItem](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsitem.html) only).
</tr>

QEvent::UngrabMouse

187

Item loses mouse grab ([QGraphicsItem](http://qt-project.org/doc/qt-5.1/qtwidgets/qgraphicsitem.html) only).
</tr>

QEvent::UpdateLater

78

The widget should be queued to be repainted at a later time.
</tr>

QEvent::UpdateRequest

77

The widget should be repainted.
</tr>

QEvent::WhatsThis

111

The widget should reveal "What's This?" help ([QHelpEvent](http://qt-project.org/doc/qt-5.1/qtgui/qhelpevent.html)).
</tr>

QEvent::WhatsThisClicked

118

A link in a widget's "What's This?" help was clicked.
</tr>

QEvent::Wheel

31

Mouse wheel rolled ([QWheelEvent](http://qt-project.org/doc/qt-5.1/qtgui/qwheelevent.html)).
</tr>

QEvent::WinEventAct

132

A Windows-specific activation event has occurred.
</tr>

QEvent::WindowActivate

24

Window was activated.
</tr>

QEvent::WindowBlocked

103

The window is blocked by a modal dialog.
</tr>

QEvent::WindowDeactivate

25

Window was deactivated.
</tr>

QEvent::WindowIconChange

34

The window's icon has changed.
</tr>

QEvent::WindowStateChange

105

The [window's state](http://qt-project.org/doc/qt-5.1/qtgui/qwindow.html#windowState) (minimized, maximized or full-screen) has changed ([QWindowStateChangeEvent](http://qt-project.org/doc/qt-5.1/qtgui/qwindowstatechangeevent.html)).
</tr>

QEvent::WindowTitleChange

33

The window title has changed.
</tr>

QEvent::WindowUnblocked

104

The window is unblocked after a modal dialog exited.
</tr>

QEvent::WinIdChange

203

The window system identifer for this native widget has changed.
</tr>

QEvent::ZOrderChange

126

The widget’s z-order has changed. This event is never sent to top level windows.

坚持原创技术分享,您的支持将鼓励我继续创作!