首页 > 其他分享 >Qt 之 事件的 类型大全

Qt 之 事件的 类型大全

时间:2022-09-29 14:22:50浏览次数:78  
标签:widget scene Qt changed Widget event 类型 QEvent 大全

enum QEvent::Type

This enum type defines the valid event types in Qt. The event types and the specialized classes for each type are as follows:

此枚举类型定义 Qt 中的有效事件类型。事件类型和每种类型的专用类如下所示:

User events should have values between User and MaxUser:

ConstantValueDescription
QEvent::User 1000 User-defined event.
QEvent::MaxUser 65535 Last user event ID.

For convenience, you can use the registerEventType() function to register and reserve a custom event type for your application. Doing so will allow you to avoid accidentally re-using a custom event type already in use elsewhere in your application.

ConstantValueDescription
QEvent::None 0 Not an event.
QEvent::ActionAdded 114 A new action has been added (QActionEvent).
QEvent::ActionChanged 113 An action has been changed (QActionEvent).
QEvent::ActionRemoved 115 An action has been removed (QActionEvent).
QEvent::ActivationChange 99 A widget's top-level window activation state has changed.
QEvent::ApplicationActivate 121 This enum has been deprecated. Use ApplicationStateChange instead.
QEvent::ApplicationActivated ApplicationActivate This enum has been deprecated. Use ApplicationStateChange instead.
QEvent::ApplicationDeactivate 122 This enum has been deprecated. Use ApplicationStateChange instead.
QEvent::ApplicationFontChange 36 The default application font has changed.
QEvent::ApplicationLayoutDirectionChange 37 The default application layout direction has changed.
QEvent::ApplicationPaletteChange 38 The default application palette has changed.
QEvent::ApplicationStateChange 214 The state of the application has changed.
QEvent::ApplicationWindowIconChange 35 The application's icon has changed.
QEvent::ChildAdded 68 An object gets a child (QChildEvent).
QEvent::ChildPolished 69 A widget child gets polished (QChildEvent).
QEvent::ChildRemoved 71 An object loses a child (QChildEvent).
QEvent::Clipboard 40 The clipboard contents have changed.
QEvent::Close 19 Widget was closed (QCloseEvent).
QEvent::CloseSoftwareInputPanel 200 A widget wants to close the software input panel (SIP).
QEvent::ContentsRectChange 178 The margins of the widget's content rect changed.
QEvent::ContextMenu 82 Context popup menu (QContextMenuEvent).
QEvent::CursorChange 183 The widget's cursor has changed.
QEvent::DeferredDelete 52 The object will be deleted after it has cleaned up (QDeferredDeleteEvent)
QEvent::DragEnter 60 The cursor enters a widget during a drag and drop operation (QDragEnterEvent).
QEvent::DragLeave 62 The cursor leaves a widget during a drag and drop operation (QDragLeaveEvent).
QEvent::DragMove 61 A drag and drop operation is in progress (QDragMoveEvent).
QEvent::Drop 63 A drag and drop operation is completed (QDropEvent).
QEvent::DynamicPropertyChange 170 A dynamic property was added, changed, or removed from the object.
QEvent::EnabledChange 98 Widget's enabled state has changed.
QEvent::Enter 10 Mouse enters widget's boundaries (QEnterEvent).
QEvent::EnterEditFocus 150 An editor widget gains focus for editing. QT_KEYPAD_NAVIGATION must be defined.
QEvent::EnterWhatsThisMode 124 Send to toplevel widgets when the application enters "What's This?" mode.
QEvent::Expose 206 Sent to a window when its on-screen contents are invalidated and need to be flushed from the backing store.
QEvent::FileOpen 116 File open request (QFileOpenEvent).
QEvent::FocusIn 8 Widget or Window gains keyboard focus (QFocusEvent).
QEvent::FocusOut 9 Widget or Window loses keyboard focus (QFocusEvent).
QEvent::FocusAboutToChange 23 Widget or Window focus is about to change (QFocusEvent)
QEvent::FontChange 97 Widget's font has changed.
QEvent::Gesture 198 A gesture was triggered (QGestureEvent).
QEvent::GestureOverride 202 A gesture override was triggered (QGestureEvent).
QEvent::GrabKeyboard 188 Item gains keyboard grab (QGraphicsItem only).
QEvent::GrabMouse 186 Item gains mouse grab (QGraphicsItem only).
QEvent::GraphicsSceneContextMenu 159 Context popup menu over a graphics scene (QGraphicsSceneContextMenuEvent).
QEvent::GraphicsSceneDragEnter 164 The cursor enters a graphics scene during a drag and drop operation (QGraphicsSceneDragDropEvent).
QEvent::GraphicsSceneDragLeave 166 The cursor leaves a graphics scene during a drag and drop operation (QGraphicsSceneDragDropEvent).
QEvent::GraphicsSceneDragMove 165 A drag and drop operation is in progress over a scene (QGraphicsSceneDragDropEvent).
QEvent::GraphicsSceneDrop 167 A drag and drop operation is completed over a scene (QGraphicsSceneDragDropEvent).
QEvent::GraphicsSceneHelp 163 The user requests help for a graphics scene (QHelpEvent).
QEvent::GraphicsSceneHoverEnter 160 The mouse cursor enters a hover item in a graphics scene (QGraphicsSceneHoverEvent).
QEvent::GraphicsSceneHoverLeave 162 The mouse cursor leaves a hover item in a graphics scene (QGraphicsSceneHoverEvent).
QEvent::GraphicsSceneHoverMove 161 The mouse cursor moves inside a hover item in a graphics scene (QGraphicsSceneHoverEvent).
QEvent::GraphicsSceneMouseDoubleClick 158 Mouse press again (double click) in a graphics scene (QGraphicsSceneMouseEvent).
QEvent::GraphicsSceneMouseMove 155 Move mouse in a graphics scene (QGraphicsSceneMouseEvent).
QEvent::GraphicsSceneMousePress 156 Mouse press in a graphics scene (QGraphicsSceneMouseEvent).
QEvent::GraphicsSceneMouseRelease 157 Mouse release in a graphics scene (QGraphicsSceneMouseEvent).
QEvent::GraphicsSceneMove 182 Widget was moved (QGraphicsSceneMoveEvent).
QEvent::GraphicsSceneResize 181 Widget was resized (QGraphicsSceneResizeEvent).
QEvent::GraphicsSceneWheel 168 Mouse wheel rolled in a graphics scene (QGraphicsSceneWheelEvent).
QEvent::Hide 18 Widget was hidden (QHideEvent).
QEvent::HideToParent 27 A child widget has been hidden.
QEvent::HoverEnter 127 The mouse cursor enters a hover widget (QHoverEvent).
QEvent::HoverLeave 128 The mouse cursor leaves a hover widget (QHoverEvent).
QEvent::HoverMove 129 The mouse cursor moves inside a hover widget (QHoverEvent).
QEvent::IconDrag 96 The main icon of a window has been dragged away (QIconDragEvent).
QEvent::IconTextChange 101 Widget's icon text has been changed. (Deprecated)
QEvent::InputMethod 83 An input method is being used (QInputMethodEvent).
QEvent::InputMethodQuery 207 A input method query event (QInputMethodQueryEvent)
QEvent::KeyboardLayoutChange 169 The keyboard layout has changed.
QEvent::KeyPress 6 Key press (QKeyEvent).
QEvent::KeyRelease 7 Key release (QKeyEvent).
QEvent::LanguageChange 89 The application translation changed.
QEvent::LayoutDirectionChange 90 The direction of layouts changed.
QEvent::LayoutRequest 76 Widget layout needs to be redone.
QEvent::Leave 11 Mouse leaves widget's boundaries.
QEvent::LeaveEditFocus 151 An editor widget loses focus for editing. QT_KEYPAD_NAVIGATION must be defined.
QEvent::LeaveWhatsThisMode 125 Send to toplevel widgets when the application leaves "What's This?" mode.
QEvent::LocaleChange 88 The system locale has changed.
QEvent::NonClientAreaMouseButtonDblClick 176 A mouse double click occurred outside the client area (QMouseEvent).
QEvent::NonClientAreaMouseButtonPress 174 A mouse button press occurred outside the client area (QMouseEvent).
QEvent::NonClientAreaMouseButtonRelease 175 A mouse button release occurred outside the client area (QMouseEvent).
QEvent::NonClientAreaMouseMove 173 A mouse move occurred outside the client area (QMouseEvent).
QEvent::MacSizeChange 177 The user changed his widget sizes (macOS only).
QEvent::MetaCall 43 An asynchronous method invocation via QMetaObject::invokeMethod().
QEvent::ModifiedChange 102 Widgets modification state has been changed.
QEvent::MouseButtonDblClick 4 Mouse press again (QMouseEvent).
QEvent::MouseButtonPress 2 Mouse press (QMouseEvent).
QEvent::MouseButtonRelease 3 Mouse release (QMouseEvent).
QEvent::MouseMove 5 Mouse move (QMouseEvent).
QEvent::MouseTrackingChange 109 The mouse tracking state has changed.
QEvent::Move 13 Widget's position changed (QMoveEvent).
QEvent::NativeGesture 197 The system has detected a gesture (QNativeGestureEvent).
QEvent::OrientationChange 208 The screens orientation has changes (QScreenOrientationChangeEvent).
QEvent::Paint 12 Screen update necessary (QPaintEvent).
QEvent::PaletteChange 39 Palette of the widget changed.
QEvent::ParentAboutToChange 131 The widget parent is about to change.
QEvent::ParentChange 21 The widget parent has changed.
QEvent::PlatformPanel 212 A platform specific panel has been requested.
QEvent::PlatformSurface 217 A native platform surface has been created or is about to be destroyed (QPlatformSurfaceEvent).
QEvent::Polish 75 The widget is polished.
QEvent::PolishRequest 74 The widget should be polished.
QEvent::QueryWhatsThis 123 The widget should accept the event if it has "What's This?" help (QHelpEvent).
QEvent::ReadOnlyChange 106 Widget's read-only state has changed (since Qt 5.4).
QEvent::RequestSoftwareInputPanel 199 A widget wants to open a software input panel (SIP).
QEvent::Resize 14 Widget's size changed (QResizeEvent).
QEvent::ScrollPrepare 204 The object needs to fill in its geometry information (QScrollPrepareEvent).
QEvent::Scroll 205 The object needs to scroll to the supplied position (QScrollEvent).
QEvent::Shortcut 117 Key press in child for shortcut key handling (QShortcutEvent).
QEvent::ShortcutOverride 51 Key press in child, for overriding shortcut key handling (QKeyEvent). When a shortcut is about to trigger, ShortcutOverride is sent to the active window. This allows clients (e.g. widgets) to signal that they will handle the shortcut themselves, by accepting the event. If the shortcut override is accepted, the event is delivered as a normal key press to the focus widget. Otherwise, it triggers the shortcut action, if one exists.
QEvent::Show 17 Widget was shown on screen (QShowEvent).
QEvent::ShowToParent 26 A child widget has been shown.
QEvent::SockAct 50 Socket activated, used to implement QSocketNotifier.
QEvent::StateMachineSignal 192 A signal delivered to a state machine (QStateMachine::SignalEvent).
QEvent::StateMachineWrapped 193 The event is a wrapper for, i.e., contains, another event (QStateMachine::WrappedEvent).
QEvent::StatusTip 112 A status tip is requested (QStatusTipEvent).
QEvent::StyleChange 100 Widget's style has been changed.
QEvent::TabletMove 87 Wacom tablet move (QTabletEvent).
QEvent::TabletPress 92 Wacom tablet press (QTabletEvent).
QEvent::TabletRelease 93 Wacom tablet release (QTabletEvent).
QEvent::TabletEnterProximity 171 Wacom tablet enter proximity event (QTabletEvent), sent to QApplication.
QEvent::TabletLeaveProximity 172 Wacom tablet leave proximity event (QTabletEvent), sent to QApplication.
QEvent::TabletTrackingChange 219 The Wacom tablet tracking state has changed (since Qt 5.9).
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().
QEvent::Timer 1 Regular timer events (QTimerEvent).
QEvent::ToolBarChange 120 The toolbar button is toggled on macOS.
QEvent::ToolTip 110 A tooltip was requested (QHelpEvent).
QEvent::ToolTipChange 184 The widget's tooltip has changed.
QEvent::TouchBegin 194 Beginning of a sequence of touch-screen or track-pad events (QTouchEvent).
QEvent::TouchCancel 209 Cancellation of touch-event sequence (QTouchEvent).
QEvent::TouchEnd 196 End of touch-event sequence (QTouchEvent).
QEvent::TouchUpdate 195 Touch-screen event (QTouchEvent).
QEvent::UngrabKeyboard 189 Item loses keyboard grab (QGraphicsItem only).
QEvent::UngrabMouse 187 Item loses mouse grab (QGraphicsItem, QQuickItem).
QEvent::UpdateLater 78 The widget should be queued to be repainted at a later time.
QEvent::UpdateRequest 77 The widget should be repainted.
QEvent::WhatsThis 111 The widget should reveal "What's This?" help (QHelpEvent).
QEvent::WhatsThisClicked 118 A link in a widget's "What's This?" help was clicked.
QEvent::Wheel 31 Mouse wheel rolled (QWheelEvent).
QEvent::WinEventAct 132 A Windows-specific activation event has occurred.
QEvent::WindowActivate 24 Window was activated.
QEvent::WindowBlocked 103 The window is blocked by a modal dialog.
QEvent::WindowDeactivate 25 Window was deactivated.
QEvent::WindowIconChange 34 The window's icon has changed.
QEvent::WindowStateChange 105 The window's state (minimized, maximized or full-screen) has changed (QWindowStateChangeEvent).
QEvent::WindowTitleChange 33 The window title has changed.
QEvent::WindowUnblocked 104 The window is unblocked after a modal dialog exited.
QEvent::WinIdChange 203 The window system identifier for this native widget has changed.
QEvent::ZOrderChange 126 The widget's z-order has changed. This event is never sent to top level windows.

标签:widget,scene,Qt,changed,Widget,event,类型,QEvent,大全
From: https://www.cnblogs.com/naihaizhuoxia/p/16741407.html

相关文章

  • Qt小技巧15.Pro文件的床边故事
    1引言这篇文章很简单,小结下Pro文件的那些好用但是又不常用的功能,用好了Pro文件,对开发人员来说那是大有裨益,身体倍儿棒。2说正事2.1定义一个字符串宏例如我想定义一......
  • 【C语言_2】整型和浮点型数据类型
    一、整型数据类型1、整型数据类型名称及关键词   2、为什么要定义不同的整型类型?   因为不同的数据类型所占用的内存大小是不同的,他们可表示的数据范围也......
  • QT——vs 中配置qt动态库,无法解析外部命令,解决办法
    vs+qt动态库无法解析外部符号的问题原文链接https://itcn.blog/p/0541664353.html 1、问题描述:无法解析的外部符号解决方案:引用的库没有引用进来,结局方案如下:(1......
  • Qt6.2.4 Arduino 上位机
    参考https://zhuanlan.zhihu.com/p/507277665https://blog.csdn.net/weixin_43491568/article/details/102959168环境环境版本windows10Qt6.2.4Qt......
  • 代码大全01
    代码大全第二章中把软件构造类比成搭建一个房子,我觉得非常形象,做房子首先要进行图纸的设计,然后根据这个设计搭建一个骨架,再通过这个骨架砌砖,糊墙等等之类的,最后装修,装饰一......
  • JAVA 类型转换
    数字转string方法一:通过包装类来实现Strings=String.valueOf(n);方法二:直接通过空字符串+数字的形式转换为字符串Stringss=""+n;方法三:强制类型转换Strings......
  • MQTTnet3.1.2 服务端
    usingMQTT;usingMQTTnet.Client;usingMQTTnet.Protocol;usingMQTTnet;usingMQTTnet.Server;usingSystem;usingSystem.Collections.Generic;usingSystem.Te......
  • Flask 学习-81.Flask-RESTX使用reqparse 解析器校验枚举类型choices 参数
    前言reqparse.RequestParser()解析器可以校验枚举类型,在add_argument中使用choices参数choices设置参数可选值比如性别设置可选项:男、女defpost(self):......
  • 《代码大全2》阅读笔记9-1
    近来浅读《代码大全2》的前言以及前一二章,做出以下总结,首先在前言部分我了解了书本的整体内容,明白来作者的著书原因,以及我将能从这本书中收获什么。并且作者详细的介绍了这......
  • Go基础编程:复合类型—切片slice
    1.概述数组的长度在定义之后无法再次修改;数组是值类型,每次传递都将产生一份副本。显然这种数据结构无法完全满足开发者的真实需求。Go语言提供了数组切片(slice)来弥补数组的......