标签:
140种事件类型:
QEvent::None
QEvent::AccessibilityDescription
QEvent::AccessibilityHelp
QEvent::AccessibilityPrepare
QEvent::ActionAdded
QEvent::ActionChanged
QEvent::ActionRemoved
QEvent::ActivationChange
QEvent::ApplicationActivate
QEvent::ApplicationActivated
QEvent::ApplicationDeactivate
QEvent::ApplicationFontChange
QEvent::ApplicationLayoutDirectionChange
QEvent::ApplicationPaletteChange
QEvent::ApplicationWindowIconChange
QEvent::ChildAdded
QEvent::ChildInserted
QEvent::ChildPolished
QEvent::ChildRemoved
QEvent::Clipboard
QEvent::Close
QEvent::CloseSoftwareInputPanel
QEvent::ContentsRectChange
QEvent::ContextMenu
QEvent::CursorChange
QEvent::DeferredDelete
QEvent::DragEnter
QEvent::DragLeave
QEvent::DragMove
QEvent::Drop
QEvent::EnabledChange
QEvent::Enter
QEvent::EnterEditFocus
QEvent::EnterWhatsThisMode
QEvent::FileOpen
QEvent::FocusIn
QEvent::FocusOut
QEvent::FontChange
QEvent::GrabKeyboard
QEvent::GrabMouse
QEvent::GraphicsSceneContextMenu
QEvent::GraphicsSceneDragEnter
QEvent::GraphicsSceneDragLeave
QEvent::GraphicsSceneDragMove
QEvent::GraphicsSceneDrop
QEvent::GraphicsSceneHelp
QEvent::GraphicsSceneHoverEnter
QEvent::GraphicsSceneHoverLeave
QEvent::GraphicsSceneHoverMove
QEvent::GraphicsSceneMouseDouble
QEvent::GraphicsSceneMouseMove
QEvent::GraphicsSceneMousePress
QEvent::GraphicsSceneMouseRelease
QEvent::GraphicsSceneMove
QEvent::GraphicsSceneResize
QEvent::GraphicsSceneWheel
QEvent::Hide
QEvent::HideToParent
QEvent::HoverEnter
QEvent::HoverLeave
QEvent::HoverMove
QEvent::IconDrag
QEvent::IconTextChange
QEvent::InputMethod
QEvent::KeyPress
QEvent::KeyRelease
QEvent::LanguageChange
QEvent::LayoutDirectionChange
QEvent::LayoutRequest
QEvent::Leave
QEvent::LeaveEditFocus
QEvent::LeaveWhatsThisMode
QEvent::LocaleChange
QEvent::NonClientAreaMouseButtonDblClick
QEvent::NonClientAreaMouseButtonPress
QEvent::NonClientAreaMouseButtonRelease
QEvent::NonClientAreaMouseMove
QEvent::MacSizeChange
QEvent::MenubarUpdated
QEvent::MetaCall
QEvent::ModifiedChange
QEvent::MouseButtonDblClick
QEvent::MouseButtonPress
QEvent::MouseButtonRelease
QEvent::MouseMove
QEvent::MouseTrackingChange
QEvent::Move
QEvent::Paint
QEvent::PaletteChange
QEvent::ParentAboutToChange
QEvent::ParentChange
QEvent::PlatformPanel
QEvent::Polish
QEvent::PolishRequest
QEvent::QueryWhatsThis
QEvent::RequestSoftwareInputPanel
QEvent::Resize
QEvent::Shortcut
QEvent::ShortcutOverride
QEvent::Show
QEvent::ShowToParent
QEvent::SockAct
QEvent::StateMachineSignal
QEvent::StateMachineWrapped
QEvent::StatusTip
QEvent::StyleChange
QEvent::TabletMove
QEvent::TabletPress
QEvent::TabletRelease
QEvent::OkRequest
QEvent::TabletEnterProximity
QEvent::TabletLeaveProximity
QEvent::Timer
QEvent::ToolBarChange
QEvent::ToolTip
QEvent::ToolTipChange
QEvent::UngrabKeyboard
QEvent::UngrabMouse
QEvent::UpdateLater
QEvent::UpdateRequest
QEvent::WhatsThis
QEvent::WhatsThisClicked
QEvent::Wheel
QEvent::WinEventAct
QEvent::WindowActivate
QEvent::WindowBlocked
QEvent::WindowDeactivate
QEvent::WindowIconChange
QEvent::WindowStateChange
QEvent::WindowTitleChange
QEvent::WindowUnblocked
QEvent::ZOrderChange
QEvent::KeyboardLayoutChange
QEvent::DynamicPropertyChange
QEvent::TouchBegin
QEvent::TouchUpdate
QEvent::TouchEnd
QEvent::WinIdChange
QEvent::Gesture
QEvent::GestureOverride
这么多类型,其实是分布在不同的继承类里使用。。。
--------------------------------------------------------
29个事件继承类:
QAccessibleEvent
QActionEvent
QChildEvent
QCloseEvent
QCustomEvent
QDragLeaveEvent
QDropEvent
QDynamicPropertyChangeEvent
QFileOpenEvent
QFocusEvent
QGestureEvent
QGraphicsSceneEvent
QHelpEvent
QHideEvent
QHoverEvent
QIconDragEvent
QInputEvent
QInputMethodEvent
QMoveEvent
QPaintEvent
QResizeEvent
QShortcutEvent
QShowEvent
QStateMachine::SignalEvent
QStateMachine::WrappedEvent
QStatusTipEvent
QTimerEvent
QWhatsThisClickedEvent
QWindowStateChangeEvent
--------------------------------------------------------
7个事件自带函数:
void accept()
void ignore()
bool isAccepted() const
void setAccepted(bool accepted)
bool spontaneous() const
Type type() const
int registerEventType(int hint = -1)
--------------------------------------------------------
几个关键的事件处理函数(其实就是分布在QObject,QWidget,QCoreApplication类里):
QObject::event()
QObject::installEventFilter()
QWidget::event()
QCoreApplication::sendEvent()
QCoreApplication::postEvent()
QCoreApplication::processEvents()
--------------------------------------------------------
事件(来源)分为三种:系统产生的,QT产生的,程序员产生的
参考:http://blog.csdn.net/jianchi88/article/details/7017022
--------------------------------------------------------
有空增加1、2个关键的例子来讲解一下事件的用法和诀窍
QEvent整理归纳:140种类型,29个继承类,7个函数,3种事件来源
标签:
原文地址:http://www.cnblogs.com/findumars/p/4700343.html