qkeysequence.html

来自「QT 下载资料仅供参考」· HTML 代码 · 共 161 行

HTML
161
字号
<!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/qkeysequence.cpp:51 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QKeySequence 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&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;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>QKeySequence Class Reference</h1><p>The QKeySequence class encapsulates a key sequence as usedby accelerators.<a href="#details">More...</a><p><tt>#include &lt;<a href="qkeysequence-h.html">qkeysequence.h</a>&gt;</tt><p>Inherits <a href="qt.html">Qt</a>.<p><a href="qkeysequence-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QKeySequence"><b>QKeySequence</b></a> ()</div></li><li><div class=fn><a href="#QKeySequence-2"><b>QKeySequence</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key )</div></li><li><div class=fn><a href="#QKeySequence-3"><b>QKeySequence</b></a> ( int&nbsp;key )</div></li><li><div class=fn><a href="#operator-QString"><b>operator QString</b></a> () const</div></li><li><div class=fn><a href="#operator-int"><b>operator int</b></a> () const</div></li><li><div class=fn><a href="#QKeySequence-4"><b>QKeySequence</b></a> ( const&nbsp;QKeySequence&nbsp;&amp;&nbsp;keysequence )</div></li><li><div class=fn>QKeySequence &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QKeySequence&nbsp;&amp;&nbsp;keysequence )</div></li><li><div class=fn><a href="#~QKeySequence"><b>~QKeySequence</b></a> ()</div></li><li><div class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;QKeySequence&nbsp;&amp;&nbsp;keysequence ) const</div></li><li><div class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const&nbsp;QKeySequence&nbsp;&amp;&nbsp;keysequence ) const</div></li></ul><h2>Related Functions</h2><ul><li><div class=fn>QDataStream &amp; <a href="#operator-lt-lt"><b>operator&lt;&lt;</b></a> ( QDataStream&nbsp;&amp;&nbsp;s, const&nbsp;QKeySequence&nbsp;&amp;&nbsp;keysequence )</div></li><li><div class=fn>QDataStream &amp; <a href="#operator-gt-gt"><b>operator&gt;&gt;</b></a> ( QDataStream&nbsp;&amp;&nbsp;s, QKeySequence&nbsp;&amp;&nbsp;keysequence )</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QKeySequence class encapsulates a key sequence as usedby accelerators.<p> <p> A key sequence consists of a keyboard code, optionally combinedwith modifiers, e.g. <a href="qt.html#Modifier-enum">SHIFT</a>, <a href="qt.html#Modifier-enum">CTRL</a>, <a href="qt.html#Modifier-enum">ALT</a> or <a href="qt.html#Modifier-enum">UNICODE_ACCEL</a>. For example, <tt>CTRL + Key_P</tt> might be a sequenceused as a shortcut for printing a document. The key codes arelisted in <a href="qnamespace-h.html">qnamespace.h</a>. As an alternative, use <a href="qt.html#Modifier-enum">UNICODE_ACCEL</a> with the unicode code point of the character. Forexample, <tt>UNICODE_ACCEL + 'A'</tt> gives the same key sequence as <a href="qt.html#Key-enum">Key_A</a>.<p> Key sequences can be constructed either from an integer key code,or from a human readable translatable string. A key sequence canbe cast to a <a href="qstring.html">QString</a> to obtain a human readable translated versionof the sequence. Translations are done in the "QAccel" context.<p> <p>See also <a href="qaccel.html">QAccel</a> and <a href="misc.html">Miscellaneous Classes</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QKeySequence"></a>QKeySequence::QKeySequence ()</h3>Constructs an empty key sequence.<h3 class=fn><a name="QKeySequence-2"></a>QKeySequence::QKeySequence ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key )</h3>Creates a key sequence from the string <em>key</em>. For example"Ctrl+O" gives CTRL+UNICODE_ACCEL+'O'. The strings "Ctrl", "Shift"and "Alt" are recognized, as well as their translated equivalentsin the "QAccel" context (using <a href="qobject.html#tr">QObject::tr</a>()).<p> This contructor is typically used with <a href="qobject.html#tr">tr</a>(), so that accelerator keys can be replaced intranslations:<p> <pre>        <a href="qpopupmenu.html">QPopupMenu</a> *file = new <a href="qpopupmenu.html">QPopupMenu</a>( this );        file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( tr("&amp;Open..."), this, SLOT(open()),                          <a href="#QKeySequence">QKeySequence</a>( tr("Ctrl+O", "File|Open") ) );    </pre> <p> Note the <tt>"File|Open"</tt> translator comment. It is by no meansnecessary, but it provides some context for the human translator.<h3 class=fn><a name="QKeySequence-3"></a>QKeySequence::QKeySequence ( int&nbsp;key )</h3>Constructs a key sequence from the keycode <em>key</em>.<p> The key codes are listed in <a href="qnamespace-h.html">qnamespace.h</a> and can be combinedwith modifiers, e.g. with <a href="qt.html#Modifier-enum">SHIFT</a>, <a href="qt.html#Modifier-enum">CTRL</a>, <a href="qt.html#Modifier-enum">ALT</a> or <a href="qt.html#Modifier-enum">UNICODE_ACCEL</a>.<h3 class=fn><a name="QKeySequence-4"></a>QKeySequence::QKeySequence ( const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;keysequence )</h3>Copy constructor. Makes a copy of <em>keysequence</em>.<h3 class=fn><a name="~QKeySequence"></a>QKeySequence::~QKeySequence ()</h3>Destroys the key sequence.<h3 class=fn><a name="operator-QString"></a>QKeySequence::operator QString () const</h3>Creates an accelerator string for the key sequence. For example,CTRL+Key_O gives "Ctrl+O". The strings, "Ctrl", "Shift", etc. aretranslated (using <a href="qobject.html#tr">QObject::tr</a>()) in the "QAccel" context.<h3 class=fn><a name="operator-int"></a>QKeySequence::operator int () const</h3>For backward compatibility: returns the keycode as an integer.<p> If QKeySequence ever supports more than one keycode, this functionwill return the first one.<h3 class=fn>bool <a name="operator!-eq"></a>QKeySequence::operator!= ( const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;keysequence ) const</h3>Returns TRUE if <em>keysequence</em> is not equal to this key sequence;otherwise returns FALSE.<h3 class=fn><a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp; <a name="operator-eq"></a>QKeySequence::operator= ( const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;keysequence )</h3>Assignment operator. Assigns <em>keysequence</em> to this object.<h3 class=fn>bool <a name="operator-eq-eq"></a>QKeySequence::operator== ( const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;keysequence ) const</h3>Returns TRUE if <em>keysequence</em> is equal to this key sequence;otherwise returns FALSE.<hr><h2>Related Functions</h2><h3 class=fn><a href="qdatastream.html">QDataStream</a>&nbsp;&amp; <a name="operator-lt-lt"></a>operator&lt;&lt; ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;s, const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;keysequence )</h3><p> Writes the key sequence <em>keysequence</em> to the stream <em>s</em>.<p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.<h3 class=fn><a href="qdatastream.html">QDataStream</a>&nbsp;&amp; <a name="operator-gt-gt"></a>operator&gt;&gt; ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;s, <a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;keysequence )</h3><p> Reads a key sequence from the stream <em>s</em> into the key sequence <em>keysequence</em>.<p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 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 &copy; 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 + -
显示快捷键?