Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1449

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/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 used by 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 used by accelerators.
<p> 
<p> A key sequence consists of a keyboard code, optionally combined with
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 sequence used as a shortcut for
printing a document. The key codes are listed 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. For example, <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 can
be cast to a <a href="qstring.html">QString</a> to obtain a human readable translated
version of the sequence. Translations are done in the "QAccel"
scope.
<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 equivalents in the
"QAccel" scope (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 in
translations:
<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 means
necessary, 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 combined with
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 instance CTRL+Key_O gives "Ctrl+O".  The strings, "Ctrl",
"Shift", etc. are translated (using <a href="qobject.html#tr">QObject::tr</a>()) in the "QAccel"
scope.

<h3 class=fn><a name="operator-int"></a>QKeySequence::operator int () const
</h3>
For backward compatibility: returns the keycode as integer.
<p> If QKeySequence ever supports more than one keycode, this function
will 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>

Writes the key sequence <em>keysequence</em> to the stream <em>s</em>.
<p> <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>

Reads a key sequence from the stream <em>s</em> into the key sequence <em>keysequence</em>.

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<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; 2001 
<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.2</div>
</table></div></address></body>
</html>