qimevent.html
来自「QT 下载资料仅供参考」· HTML 代码 · 共 165 行
HTML
165 行
<!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:1632 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QIMEvent Class</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; }--></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">Home</font></a> | <a href="classes.html"><font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</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>QIMEvent Class Reference</h1><p>The QIMEvent class provides parameters for input method events.<a href="#details">More...</a><p><tt>#include <<a href="qevent-h.html">qevent.h</a>></tt><p>Inherits <a href="qevent.html">QEvent</a>.<p><a href="qimevent-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QIMEvent"><b>QIMEvent</b></a> ( Type type, const QString & text, int cursorPosition )</div></li><li><div class=fn>const QString & <a href="#text"><b>text</b></a> () const</div></li><li><div class=fn>int <a href="#cursorPos"><b>cursorPos</b></a> () const</div></li><li><div class=fn>bool <a href="#isAccepted"><b>isAccepted</b></a> () const</div></li><li><div class=fn>void <a href="#accept"><b>accept</b></a> ()</div></li><li><div class=fn>void <a href="#ignore"><b>ignore</b></a> ()</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QIMEvent class provides parameters for input method events.<p> <p> Input method events are sent to widgets when an input method isused to enter text into a widget. Input methods are widely used toenter text in Asian and other complex languages.<p> The events are of interest to widgets that accept keyboard inputand want to be able to correctly handle complex languages. Textinput in such languages is usually a three step process.<p> <ol type=1><li> <b>Starting to Compose</b><br>When the user presses the first key on a keyboard an input contextis created. This input context will contain a string with thetyped characters.<p> <li> <b>Composing</b><br>With every new key pressed, the input method will try to create amatching string for the text typed so far. While the input contextis active, the user can only move the cursor inside the stringbelonging to this input context.<p> <li> <b>Completing</b><br>At some point, e.g. when the user presses the Spacebar, they getto this stage, where they can choose from a number of strings thatmatch the text they have typed so far. The user can press Enter toconfirm their choice or Escape to cancel the input; in either casethe input context will be closed.</ol><p> Note that the particular key presses used for a given inputcontext may differ from those we've mentioned here, i.e. they maynot be Spacebar, Enter and Escape.<p> These three stages are represented by three different types ofevents. The IMStartEvent, IMComposeEvent and IMEndEvent. When anew input context is created, an IMStartEvent will be sent to thewidget and delivered to the <a href="qwidget.html#imStartEvent">QWidget::imStartEvent</a>() function.The widget can then update internal data structures to reflectthis.<p> After this, an IMComposeEvent will be sent to the widget forevery key the user presses. It will contain the currentcomposition string the widget has to show and the current cursorposition within the composition string. This string is temporaryand can change with every key the user types, so the widget willneed to store the state before the composition started (the stateit had when it received the IMStartEvent). IMComposeEvents will bedelivered to the <a href="qwidget.html#imComposeEvent">QWidget::imComposeEvent</a>() function.<p> Usually, widgets try to mark the part of the text that is part ofthe current composition in a way that is visible to the user. Acommonly used visual cue is to use a dotted underline.<p> After the user has selected the final string, an IMEndEvent willbe sent to the widget. The event contains the final string theuser selected, and could be empty if they cancelled thecomposition. This string should be accepted as the final text theuser entered, and the intermediate composition string should becleared. These events are delivered to <a href="qwidget.html#imEndEvent">QWidget::imEndEvent</a>().<p> If the user clicks another widget, taking the focus out of thewidget where the composition is taking place the IMEndEvent willbe sent and the string it holds will be the result of thecomposition up to that point (which may be an empty string).<p>See also <a href="events.html">Event Classes</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QIMEvent"></a>QIMEvent::QIMEvent ( <a href="qevent.html#Type-enum">Type</a> type, const <a href="qstring.html">QString</a> & text, int cursorPosition )</h3><p> Constructs a new QIMEvent with the accept flag set to FALSE. <em>type</em> can be one of QEvent::IMStartEvent, QEvent::IMComposeEventor QEvent::IMEndEvent. <em>text</em> contains the current compostionstring and <em>cursorPosition</em> the current position of the cursorinside <em>text</em>.<h3 class=fn>void <a name="accept"></a>QIMEvent::accept ()</h3><p> Sets the accept flag of the input method event object.<p> Setting the accept parameter indicates that the receiver of theevent processed the input method event.<p> The accept flag is not set by default.<p> <p>See also <a href="#ignore">ignore</a>().<h3 class=fn>int <a name="cursorPos"></a>QIMEvent::cursorPos () const</h3><p> Returns the current cursor position inside the composition string.Will return 0 for IMStartEvent and IMEndEvent.<h3 class=fn>void <a name="ignore"></a>QIMEvent::ignore ()</h3><p> Clears the accept flag parameter of the input method event object.<p> Clearing the accept parameter indicates that the event receiverdoes not want the input method event.<p> The accept flag is cleared by default.<p> <p>See also <a href="#accept">accept</a>().<h3 class=fn>bool <a name="isAccepted"></a>QIMEvent::isAccepted () const</h3><p> Returns TRUE if the receiver of the event processed the event;otherwise returns FALSE.<h3 class=fn>const <a href="qstring.html">QString</a> & <a name="text"></a>QIMEvent::text () const</h3><p> Returns the composition text. This is a null string for anIMStartEvent, and contains the final accepted string (which may beempty) in the IMEndEvent.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<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 align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?