?? qevent.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qevent.cpp:43 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Translator" content="Cavendish">
<meta name="Qt zh_CN Documents Website" content="http://www.qiliang.net/qt">
<title>QEvent類</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; font-family: "Times New Roman" }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">主頁</font></a>
| <a href="classes.html">
<font color="#004faf">所有的類</font></a>
| <a href="mainclasses.html">
<font color="#004faf">主要的類</font></a>
| <a href="annotated.html">
<font color="#004faf">注釋的類</font></a>
| <a href="groups.html">
<font color="#004faf">分組的類</font></a>
| <a href="functions.html">
<font color="#004faf">函數</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table>
<h1 align=center>QEvent類參考</h1>
<p>QEvent類是所有事件類的基類。事件類包含事件參數。
<a href="#details">詳情請見……</a>
<p><tt>#include <<a href="qevent-h.html">qevent.h</a>></tt>
<p>繼承了<a href="qt.html">Qt</a>。
<p>由<a href="qtimerevent.html">QTimerEvent</a>、<a href="qmouseevent.html">QMouseEvent</a>、<a href="qwheelevent.html">QWheelEvent</a>、<a href="qtabletevent.html">QTabletEvent</a>、<a href="qkeyevent.html">QKeyEvent</a>、<a href="qfocusevent.html">QFocusEvent</a>、<a href="qpaintevent.html">QPaintEvent</a>、<a href="qmoveevent.html">QMoveEvent</a>、<a href="qresizeevent.html">QResizeEvent</a>、<a href="qcloseevent.html">QCloseEvent</a>、<a href="qshowevent.html">QShowEvent</a>、<a href="qhideevent.html">QHideEvent</a>、<a href="qcontextmenuevent.html">QContextMenuEvent</a>、<a href="qimevent.html">QIMEvent</a>、<a href="qdropevent.html">QDropEvent</a>、<a href="qdragleaveevent.html">QDragLeaveEvent</a>、<a href="qchildevent.html">QChildEvent</a>和<a href="qcustomevent.html">QCustomEvent</a>繼承。
<p><a href="qevent-members.html">所有成員函數的列表。</a>
<h2>公有成員</h2>
<ul>
<li><div class=fn>enum Type { None = 0, Timer = 1, MouseButtonPress = 2, MouseButtonRelease = 3, MouseButtonDblClick = 4, MouseMove = 5, KeyPress = 6, KeyRelease = 7, FocusIn = 8, FocusOut = 9, Enter = 10, Leave = 11, Paint = 12, Move = 13, Resize = 14, Create = 15, Destroy = 16, Show = 17, Hide = 18, Close = 19, Quit = 20, Reparent = 21, ShowMinimized = 22, ShowNormal = 23, WindowActivate = 24, WindowDeactivate = 25, ShowToParent = 26, HideToParent = 27, ShowMaximized = 28, ShowFullScreen = 29, Accel = 30, Wheel = 31, AccelAvailable = 32, CaptionChange = 33, IconChange = 34, ParentFontChange = 35, ApplicationFontChange = 36, ParentPaletteChange = 37, ApplicationPaletteChange = 38, PaletteChange = 39, Clipboard = 40, Speech = 42, SockAct = 50, AccelOverride = 51, DeferredDelete = 52, DragEnter = 60, DragMove = 61, DragLeave = 62, Drop = 63, DragResponse = 64, ChildInserted = 70, ChildRemoved = 71, LayoutHint = 72, ShowWindowRequest = 73, ActivateControl = 80, DeactivateControl = 81, ContextMenu = 82, IMStart = 83, IMCompose = 84, IMEnd = 85, Accessibility = 86, Tablet = 87, User = 1000, MaxUser = 65535 } <em>(obsolete)</em></div></li>
<li><div class=fn><a href="#QEvent"><b>QEvent</b></a> ( Type type )</div></li>
<li><div class=fn>Type <a href="#type"><b>type</b></a> () const</div></li>
<li><div class=fn>bool <a href="#spontaneous"><b>spontaneous</b></a> () const</div></li>
</ul>
<hr><a name="details"></a><h2>詳細描述</h2>
QEvent類是所有事件類的基類。事件類包含事件參數。
<p>
<p> Qt的主事件回路(<a href="qapplication.html#exec">QApplication::exec</a>())從事件隊列里取得本地窗口系統事件,并把它們轉換為QEvent并且把這些轉換過的事件發給QObject。
<p> 通常情況下,來自于窗口系統的事件(<a href="#spontaneous">spontaneous</a>()返回真),但是它也可以使用<a href="qapplication.html#sendEvent">QApplication::sendEvent</a>()和<a href="qapplication.html#postEvent">QApplication::postEvent</a>()手動發送事件(spontaneous()返回假)。
<p> QObject通過它們的<a href="qobject.html#event">QObject::event</a>()函數調用來接收事件。這個函數可以在子類中重新實現來處理自定義的事件和添加額外的事件類型,<a href="qwidget.html#event">QWidget::event</a>()就是一個著名的例子。默認情況下,像<a href="qobject.html#timerEvent">QObject::timerEvent</a>()和<a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>()這樣的事件可以被發送給事件處理函數。<a href="qobject.html#installEventFilter">QObject::installEventFilter</a>()允許一個對象中途截取發往另一個對象的事件。
<p> 基本的QEvent只包含了一個事件類型參數。QEvent的子類包含了額外的描述特定事件的參數。
<p> <p>也可以參考<a href="qobject.html#event">QObject::event</a>()、<a href="qobject.html#installEventFilter">QObject::installEventFilter</a>()、<a href="qwidget.html#event">QWidget::event</a>()、<a href="qapplication.html#sendEvent">QApplication::sendEvent</a>()、a href="qapplication.html#postEvent">QApplication::postEvent</a>()、<a href="qapplication.html#processEvents">QApplication::processEvents</a>()、<a href="environment.html">Environment Classes</a>和<a href="events.html">事件類</a>。
<hr><h2>成員類型文檔</h2>
<h3 class=fn><a name="Type-enum"></a>QEvent::Type</h3>
<p> 這個枚舉類型定義了Qt中有效的事件類型。事件類型和每個類型的專門類如下:
<ul>
<li><tt>QEvent::None</tt> - 不是一個事件。
<li><tt>QEvent::Accessibility</tt> - 可存取性信息被請求。
<li><tt>QEvent::Timer</tt> - 規則的定時器事件,<a href="qtimerevent.html">QTimerEvent</a>。
<li><tt>QEvent::MouseButtonPress</tt> - 鼠標按下,<a href="qmouseevent.html">QMouseEvent</a>。
<li><tt>QEvent::MouseButtonRelease</tt> - 鼠標抬起,<a href="qmouseevent.html">QMouseEvent</a>。
<li><tt>QEvent::MouseButtonDblClick</tt> - 鼠標再次按下,a href="qmouseevent.html">QMouseEvent</a>。
<li><tt>QEvent::MouseMove</tt> - 鼠標移動,<a href="qmouseevent.html">QMouseEvent</a>。
<li><tt>QEvent::KeyPress</tt> - 鍵按下(舉例,包括Shift)<a href="qkeyevent.html">QKeyEvent</a>。
<li><tt>QEvent::KeyRelease</tt> - 鍵抬起,<a href="qkeyevent.html">QKeyEvent</a>。
<li><tt>QEvent::IMStart</tt> - 輸入法寫作開始。
<li><tt>QEvent::IMCompose</tt> - 發生輸入法寫作。
<li><tt>QEvent::IMEnd</tt> - 輸入法寫作結束。
<li><tt>QEvent::FocusIn</tt> - 窗口部件獲得<a href="focus.html#keyboard-focus">鍵盤焦點</a>,<a href="qfocusevent.html">QFocusEvent</a>。
<li><tt>QEvent::FocusOut</tt> - 窗口部件失去鍵盤焦點,<a href="qfocusevent.html">QFocusEvent</a>。
<li><tt>QEvent::Enter</tt> - 鼠標進入窗口部件邊緣。
<li><tt>QEvent::Leave</tt> - 鼠標離開窗口部件邊緣。
<li><tt>QEvent::Paint</tt> - 屏幕更新所需要的,<a href="qpaintevent.html">QPaintEvent</a>。
<li><tt>QEvent::Move</tt> - 窗口部件位置改變了,<a href="qmoveevent.html">QMoveEvent</a>。
<li><tt>QEvent::Resize</tt> - 窗口部件大小改變了,<a href="qresizeevent.html">QResizeEvent</a>。
<li><tt>QEvent::Show</tt> - 窗口部件被顯示到屏幕上,<a href="qshowevent.html">QShowEvent</a>。
<li><tt>QEvent::Hide</tt> - 窗口部件被隱藏,<a href="qhideevent.html">QHideEvent</a>。
<li><tt>QEvent::ShowToParent</tt> - 一個子窗口部件被顯示。
<li><tt>QEvent::HideToParent</tt> - 一個子窗口部件被隱藏。
<li><tt>QEvent::Close</tt> - 窗口部件被關閉(永久性地) <a href="qcloseevent.html">QCloseEvent</a>。
<li><tt>QEvent::ShowNormal</tt> - 窗口部件應該按通常模式顯示。
<li><tt>QEvent::ShowMaximized</tt> - 窗口部件應該按最大化模式顯示。
<li><tt>QEvent::ShowMinimized</tt> - 窗口部件應該按最小化模式顯示。
<li><tt>QEvent::ShowFullScreen</tt> - 窗口部件應該按全屏模式顯示。
<li><tt>QEvent::ShowWindowRequest</tt> - 窗口部件窗口應該被顯示。<b>這個類型是廢棄的。</b>它的提供是為了保證舊代碼能夠工作。我們強烈建議在新代碼中不要使用它。
<li><tt>QEvent::DeferredDelete</tt> - 在這個對象被清理干凈之后,它將被刪除。
<li><tt>QEvent::Accel</tt> - 孩子中的鍵按下,用于快捷鍵處理。<a href="qkeyevent.html">QKeyEvent</a>。
<li><tt>QEvent::Wheel</tt> - 鼠標滾輪轉動,<a href="qwheelevent.html">QWheelEvent</a>。
<li><tt>QEvent::ContextMenu</tt> - 上下文彈出菜單,<a href="qcontextmenuevent.html">QContextMenuEvent</a>。
<li><tt>QEvent::AccelAvailable</tt> - 在一些平臺上Qt使用的內部事件。
<li><tt>QEvent::AccelOverride</tt> - Key press in child, for overriding shortcut key handling, <a href="qkeyevent.html">QKeyEvent</a>.
<li><tt>QEvent::WindowActivate</tt> - 窗口被激活了。
<li><tt>QEvent::WindowDeactivate</tt> - 窗口被停用了。
<li><tt>QEvent::CaptionChange</tt> - 窗口部件的標題改變了。
<li><tt>QEvent::IconChange</tt> - 窗口部件的圖標改變了。
<li><tt>QEvent::ParentFontChange</tt> - 父窗口部件的字體改變了。
<li><tt>QEvent::ApplicationFontChange</tt> - 默認的應用程序字體改變了。
<li><tt>QEvent::PaletteChange</tt> - 窗口部件的調色板改變了。
<li><tt>QEvent::ParentPaletteChange</tt> - 父窗口部件的調色板改變了。
<li><tt>QEvent::ApplicationPaletteChange</tt> - 默認的應用程序調色板改變了。
<li><tt>QEvent::Clipboard</tt> - 剪貼板內容發生改變,<a href="qclipboard.html">QClipboard</a>。
<li><tt>QEvent::SockAct</tt> - 套接字觸發,通常在<a href="qsocketnotifier.html">QSocketNotifier</a>中實現。
<li><tt>QEvent::DragEnter</tt> - 一個拖拽進入了一個窗口部件,<a href="qdragenterevent.html">QDragEnterEvent</a>。
<li><tt>QEvent::DragMove</tt> - 一個拖拽正在進行中,<a href="qdragmoveevent.html">QDragMoveEvent</a>。
<li><tt>QEvent::DragLeave</tt> - 一個拖拽離開了窗口部件,<a href="qdragleaveevent.html">QDragLeaveEvent</a>。
<li><tt>QEvent::Drop</tt> - 一個拖拽完成了,<a href="qdropevent.html">QDropEvent</a>。
<li><tt>QEvent::DragResponse</tt> - 在一些平臺上Qt使用的內部事件。
<li><tt>QEvent::ChildInserted</tt> - 對象得到了一個孩子,<a href="qchildevent.html">QChildEvent</a>。
<li><tt>QEvent::ChildRemoved</tt> - 對象失去了一個孩子,<a href="qchildevent.html">QChildEvent</a>。
<li><tt>QEvent::LayoutHint</tt> - 窗口部件孩子改變了布局屬性。
<li><tt>QEvent::ActivateControl</tt> - 在一些平臺上Qt使用的內部事件。
<li><tt>QEvent::DeactivateControl</tt> - 在一些平臺上Qt使用的內部事件。
<li><tt>QEvent::Quit</tt> - 保留的。
<li><tt>QEvent::Create</tt> - 保留的。
<li><tt>QEvent::Destroy</tt> - 保留的。
<li><tt>QEvent::Reparent</tt> - 保留的。
<li><tt>QEvent::Speech</tt> - 為語音輸入而保留的。
<li><tt>QEvent::Tablet</tt> - Wacom Tablet事件。
<li><tt>QEvent::User</tt> - 用戶定義事件。
<li><tt>QEvent::MaxUser</tt> - 最后用戶事件id。
</ul><p> 用戶事件應該包含User和MaxUser值。
<hr><h2>成員函數文檔</h2>
<h3 class=fn><a name="QEvent"></a>QEvent::QEvent ( <a href="qevent.html#Type-enum">Type</a> type )
</h3>
<p> 構造一個類型為<em>type</em>的事件對象。
<h3 class=fn>bool <a name="spontaneous"></a>QEvent::spontaneous () const
</h3>
<p> 如果事件由應用程序之外產生的,比如一個系統事件,返回真,否則返回假。
<h3 class=fn><a href="qevent.html#Type-enum">Type</a> <a name="type"></a>QEvent::type () const
</h3>
<p> 返回事件類型。
<!-- eof -->
<hr><p>
這個文件是<a href="index.html">Qt工具包</a>一部分。
版權所有 © 1995-2002
<a href="http://www.trolltech.com/">Trolltech</a>。保留所有權利。
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2002
<a href="http://www.trolltech.com">Trolltech</a>
<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td><a href="zh_CN.html">譯者:Cavendish</a>
<td align=right><div align=right>Qt 3.0.5版</div>
</table></div></address></body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -