Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 4434

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- q3accel.cpp -->
  <title>Qt 4.8: Q3Accel Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li>Qt3SupportLight</li>
<li>Q3Accel</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">Q3Accel Class Reference</h1>
<!-- $$$Q3Accel-brief -->
<p>The Q3Accel class handles keyboard accelerator and shortcut keys. <a href="#details">More...</a></p>
<!-- @@@Q3Accel -->
<pre class="cpp"> <span class="preprocessor">#include &lt;Q3Accel&gt;</span></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qaccel">Porting to Qt 4</a> for more information.</p>
<p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<ul>
<li><a href="q3accel-members.html">List of all members, including inherited members</a></li>
<li><a href="q3accel-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#Q3Accel">Q3Accel</a></b> ( QWidget * <i>parent</i>, const char * <i>name</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#Q3Accel-2">Q3Accel</a></b> ( QWidget * <i>watch</i>, QObject * <i>parent</i>, const char * <i>name</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#dtor.Q3Accel">~Q3Accel</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#connectItem">connectItem</a></b> ( int <i>id</i>, const QObject * <i>receiver</i>, const char * <i>member</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#count">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#disconnectItem">disconnectItem</a></b> ( int <i>id</i>, const QObject * <i>receiver</i>, const char * <i>member</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#findKey">findKey</a></b> ( const QKeySequence &amp; <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#insertItem">insertItem</a></b> ( const QKeySequence &amp; <i>key</i>, int <i>id</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#isEnabled">isEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#isItemEnabled">isItemEnabled</a></b> ( int <i>id</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QKeySequence </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#key">key</a></b> ( int <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#removeItem">removeItem</a></b> ( int <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#setEnabled">setEnabled</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#setItemEnabled">setItemEnabled</a></b> ( int <i>id</i>, bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#setWhatsThis">setWhatsThis</a></b> ( int <i>id</i>, const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#whatsThis">whatsThis</a></b> ( int <i>id</i> ) const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#activated">activated</a></b> ( int <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#activatedAmbiguously">activatedAmbiguously</a></b> ( int <i>id</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QKeySequence </td><td class="memItemRight bottomAlign"><b><a href="q3accel.html#shortcutKey">shortcutKey</a></b> ( const QString &amp; <i>str</i> )</td></tr>
</table>
<ul>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$Q3Accel-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The Q3Accel class handles keyboard accelerator and shortcut keys.</p>
<p>A keyboard accelerator triggers an action when a certain key combination is pressed. The accelerator handles all keyboard activity for all the children of one top-level widget, so it is not affected by the keyboard focus.</p>
<p>In most cases, you will not need to use this class directly. Use the <a href="qaction.html">QAction</a> class to create actions with accelerators that can be used in both menus and toolbars. If you're only interested in menus use Q3MenuData::insertItem() or Q3MenuData::setAccel() to make accelerators for operations that are also available on menus. Many widgets automatically generate accelerators, such as <a href="qabstractbutton.html">QAbstractButton</a>, <a href="qgroupbox.html">QGroupBox</a>, <a href="qlabel.html">QLabel</a> (with <a href="qlabel.html#setBuddy">QLabel::setBuddy</a>()), <a href="qmenubar.html">QMenuBar</a>, and <a href="qtabbar.html">QTabBar</a>. Example:</p>
<pre class="cpp"> <span class="type"><a href="qpushbutton.html">QPushButton</a></span> p(<span class="string">&quot;&amp;Exit&quot;</span><span class="operator">,</span> parent); <span class="comment">// automatic shortcut Alt+E</span>
 <span class="type"><a href="q3popupmenu.html">Q3PopupMenu</a></span> <span class="operator">*</span>fileMenu <span class="operator">=</span> <span class="keyword">new</span> fileMenu(parent);
 fileMenu<span class="operator">-</span><span class="operator">&gt;</span><a href="q3accel.html#insertItem">insertItem</a>(<span class="string">&quot;Undo&quot;</span><span class="operator">,</span> parent<span class="operator">,</span> SLOT(undo())<span class="operator">,</span>
                      <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>CTRL <span class="operator">+</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>Key_Z);</pre>
<p>A Q3Accel contains a list of accelerator items that can be manipulated using <a href="q3accel.html#insertItem">insertItem</a>(), <a href="q3accel.html#removeItem">removeItem</a>(), <a href="q3accel.html#clear">clear</a>(), <a href="q3accel.html#key">key</a>() and <a href="q3accel.html#findKey">findKey</a>().</p>
<p>Each accelerator item consists of an identifier and a <a href="qkeysequence.html">QKeySequence</a>. A single key sequence consists of a keyboard code combined with modifiers (<a href="qt.html#Modifier-enum">Qt::SHIFT</a>, <a href="qt.html#Modifier-enum">Qt::CTRL</a>, <a href="qt.html#Modifier-enum">Qt::ALT</a>, or <a href="qt.html#Modifier-enum">Qt::UNICODE_ACCEL</a>). For example, <a href="qt.html#Modifier-enum">Qt::CTRL</a> + <a href="qt.html#Key-enum">Qt::Key_P</a> could be a shortcut for printing a document. As an alternative, use <a href="qt.html#Modifier-enum">Qt::UNICODE_ACCEL</a> with the unicode code point of the character. For example, <a href="qt.html#Modifier-enum">Qt::UNICODE_ACCEL</a> + 'A' gives the same accelerator as <a href="qt.html#Key-enum">Qt::Key_A</a>.</p>
<p>When an accelerator key is pressed, the accelerator sends out the signal <a href="q3accel.html#activated">activated</a>() with a number that identifies this particular accelerator item. Accelerator items can also be individually connected, so that two different keys will activate two different slots (see <a href="q3accel.html#connectItem">connectItem</a>() and <a href="q3accel.html#disconnectItem">disconnectItem</a>()).</p>
<p>The <a href="q3accel.html#activated">activated</a>() signal is <i>not</i> emitted when two or more accelerators match the same key. Instead, the first matching accelerator sends out the <a href="q3accel.html#activatedAmbiguously">activatedAmbiguously</a>() signal. By pressing the key multiple times, users can navigate between all matching accelerators. Some standard controls like <a href="qpushbutton.html">QPushButton</a> and <a href="qcheckbox.html">QCheckBox</a> connect the <a href="q3accel.html#activatedAmbiguously">activatedAmbiguously</a>() signal to the harmless setFocus() slot, whereas <a href="q3accel.html#activated">activated</a>() is connected to a slot invoking the button's action. Most controls, like <a href="qlabel.html">QLabel</a> and <a href="qtabbar.html">QTabBar</a>, treat <a href="q3accel.html#activated">activated</a>() and <a href="q3accel.html#activatedAmbiguously">activatedAmbiguously</a>() as equivalent.</p>
<p>Use <a href="q3accel.html#setEnabled">setEnabled</a>() to enable or disable all the items in an accelerator, or <a href="q3accel.html#setItemEnabled">setItemEnabled</a>() to enable or disable individual items. An item is active only when both the Q3Accel and the item itself are enabled.</p>
<p>The function <a href="q3accel.html#setWhatsThis">setWhatsThis</a>() specifies a help text that appears when the user presses an accelerator key in What's This mode.</p>
<p>The accelerator will be deleted when <i>parent</i> is deleted, and will consume relevant key events until then.</p>
<p>Please note that the accelerator</p>
<pre class="cpp"> accelerator<span class="operator">-</span><span class="operator">&gt;</span><a href="q3accel.html#insertItem">insertItem</a>(<span class="type"><a href="qkeysequence.html">QKeySequence</a></span>(<span class="string">&quot;M&quot;</span>));</pre>
<p>can be triggered with both the 'M' key, and with Shift+M, unless a second accelerator is defined for the Shift+M combination.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type">Q3Accel</span> <span class="operator">*</span>a <span class="operator">=</span> <span class="keyword">new</span> <span class="type">Q3Accel</span>(myWindow);
 a<span class="operator">-</span><span class="operator">&gt;</span><a href="q3accel.html#connectItem">connectItem</a>(a<span class="operator">-</span><span class="operator">&gt;</span>insertItem(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>CTRL <span class="operator">+</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>Key_P)<span class="operator">,</span>
                myWindow<span class="operator">,</span> SLOT(printDoc()));</pre>
<p><a href="qabstractbutton-qt3.html#setAccel">QAbstractButton::setAccel</a>() <a href="qlabel.html#setBuddy">QLabel::setBuddy</a>() <a href="qkeysequence.html">QKeySequence</a></p>
</div>
<p><b>See also </b><a href="qkeyevent.html">QKeyEvent</a> and <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<!-- @@@Q3Accel -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Q3Accel[overload1]$$$Q3AccelQWidget*constchar* -->
<h3 class="fn"><a name="Q3Accel"></a>Q3Accel::<span class="name">Q3Accel</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i>, const <span class="type">char</span> * <i>name</i> = 0 )</h3>
<p>Constructs a <a href="q3accel.html" class="compat">Q3Accel</a> object called <i>name</i>, with parent <i>parent</i>. The accelerator operates on <i>parent</i>.</p>
<!-- @@@Q3Accel -->
<!-- $$$Q3Accel$$$Q3AccelQWidget*QObject*constchar* -->
<h3 class="fn"><a name="Q3Accel-2"></a>Q3Accel::<span class="name">Q3Accel</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>watch</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i>, const <span class="type">char</span> * <i>name</i> = 0 )</h3>
<p>Constructs a <a href="q3accel.html" class="compat">Q3Accel</a> object called <i>name</i>, that operates on <i>watch</i>, and is a child of <i>parent</i>.</p>
<p>This constructor is not needed for normal application programming.</p>
<!-- @@@Q3Accel -->
<!-- $$$~Q3Accel[overload1]$$$~Q3Accel -->
<h3 class="fn"><a name="dtor.Q3Accel"></a>Q3Accel::<span class="name">~Q3Accel</span> ()</h3>
<p>Destroys the accelerator object and frees all allocated resources.</p>
<!-- @@@~Q3Accel -->
<!-- $$$activated[overload1]$$$activatedint -->
<h3 class="fn"><a name="activated"></a><span class="type">void</span> Q3Accel::<span class="name">activated</span> ( <span class="type">int</span> <i>id</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the user types the shortcut's key sequence. <i>id</i> is a number that identifies this particular accelerator item.</p>
<p><b>See also </b><a href="q3accel.html#activatedAmbiguously">activatedAmbiguously</a>().</p>
<!-- @@@activated -->
<!-- $$$activatedAmbiguously[overload1]$$$activatedAmbiguouslyint -->
<h3 class="fn"><a name="activatedAmbiguously"></a><span class="type">void</span> Q3Accel::<span class="name">activatedAmbiguously</span> ( <span class="type">int</span> <i>id</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the user types a shortcut key sequence that is ambiguous. For example, if one key sequence is a &quot;prefix&quot; for another and the user types these keys it isn't clear if they want the shorter key sequence, or if they're about to type more to complete the longer key sequence. <i>id</i> is a number that identifies this particular accelerator item.</p>
<p><b>See also </b><a href="q3accel.html#activated">activated</a>().</p>
<!-- @@@activatedAmbiguously -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> Q3Accel::<span class="name">clear</span> ()</h3>
<p>Removes all accelerator items.</p>
<!-- @@@clear -->
<!-- $$$connectItem[overload1]$$$connectItemintconstQObject*constchar* -->
<h3 class="fn"><a name="connectItem"></a><span class="type">bool</span> Q3Accel::<span class="name">connectItem</span> ( <span class="type">int</span> <i>id</i>, const <span class="type"><a href="qobject.html">QObject</a></span> * <i>receiver</i>, const <span class="type">char</span> * <i>member</i> )</h3>
<p>Connects the accelerator item <i>id</i> to the slot <i>member</i> of <i>receiver</i>. Returns true if the connection is successful.</p>
<pre class="cpp"> a<span class="operator">-</span><span class="operator">&gt;</span>connectItem(<span class="number">201</span><span class="operator">,</span> mainView<span class="operator">,</span> SLOT(quit()));</pre>
<p>Of course, you can also send a signal as <i>member</i>.</p>
<p>Normally accelerators are connected to slots which then receive the <tt>activated(int id)</tt> signal with the id of the accelerator item that was activated. If you choose to connect a specific accelerator item using this function, the <tt>activated()</tt> signal is emitted if the associated key sequence is pressed but no <tt>activated(int id)</tt> signal is emitted.</p>
<p><b>See also </b><a href="q3accel.html#disconnectItem">disconnectItem</a>() and <a href="qobject.html#connect">QObject::connect</a>().</p>
<!-- @@@connectItem -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn"><a name="count"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> Q3Accel::<span class="name">count</span> () const</h3>
<p>Returns the number of accelerator items in this accelerator.</p>
<!-- @@@count -->
<!-- $$$disconnectItem[overload1]$$$disconnectItemintconstQObject*constchar* -->
<h3 class="fn"><a name="disconnectItem"></a><span class="type">bool</span> Q3Accel::<span class="name">disconnectItem</span> ( <span class="type">int</span> <i>id</i>, const <span class="type"><a href="qobject.html">QObject</a></span> * <i>receiver</i>, const <span class="type">char</span> * <i>member</i> )</h3>
<p>Disconnects the accelerator item identified by <i>id</i> from the function called <i>member</i> in the <i>receiver</i> object. Returns true if the connection existed and the disconnect was successful.</p>
<p><b>See also </b><a href="q3accel.html#connectItem">connectItem</a>() and <a href="qobject.html#disconnect">QObject::disconnect</a>().</p>
<!-- @@@disconnectItem -->
<!-- $$$findKey[overload1]$$$findKeyconstQKeySequence& -->
<h3 class="fn"><a name="findKey"></a><span class="type">int</span> Q3Accel::<span class="name">findKey</span> ( const <span class="type"><a href="qkeysequence.html">QKeySequence</a></span> &amp; <i>key</i> ) const</h3>
<p>Returns the identifier of the accelerator item with the key code <i>key</i>, or -1 if the item cannot be found.</p>
<!-- @@@findKey -->
<!-- $$$insertItem[overload1]$$$insertItemconstQKeySequence&int -->
<h3 class="fn"><a name="insertItem"></a><span class="type">int</span> Q3Accel::<span class="name">insertItem</span> ( const <span class="type"><a href="qkeysequence.html">QKeySequence</a></span> &amp; <i>key</i>, <span class="type">int</span> <i>id</i> = -1 )</h3>
<p>Inserts an accelerator item and returns the item's identifier.</p>
<p><i>key</i> is a key code and an optional combination of SHIFT, CTRL and ALT. <i>id</i> is the accelerator item id.</p>
<p>If <i>id</i> is negative, then the item will be assigned a unique negative identifier less than -1.</p>
<pre class="cpp"> <span class="type"><a href="q3accel.html">Q3Accel</a></span> <span class="operator">*</span>a <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="q3accel.html">Q3Accel</a></span>(myWindow);        <span class="comment">// create accels for myWindow</span>
 a<span class="operator">-</span><span class="operator">&gt;</span>insertItem(CTRL <span class="operator">+</span> Key_P<span class="operator">,</span> <span class="number">200</span>);          <span class="comment">// Ctrl+P, e.g. to print document</span>
 a<span class="operator">-</span><span class="operator">&gt;</span>insertItem(ALT <span class="operator">+</span> Key_X<span class="operator">,</span> <span class="number">201</span>);           <span class="comment">// Alt+X, e.g. to quit</span>
 a<span class="operator">-</span><span class="operator">&gt;</span>insertItem(UNICODE_ACCEL <span class="operator">+</span> <span class="char">'q'</span><span class="operator">,</span> <span class="number">202</span>);   <span class="comment">// Unicode 'q', e.g. to quit</span>
 a<span class="operator">-</span><span class="operator">&gt;</span>insertItem(Key_D);                      <span class="comment">// gets a unique negative id &lt; -1</span>
 a<span class="operator">-</span><span class="operator">&gt;</span>insertItem(CTRL <span class="operator">+</span> SHIFT <span class="operator">+</span> Key_P);       <span class="comment">// gets a unique negative id &lt; -1</span></pre>
<!-- @@@insertItem -->
<!-- $$$isEnabled[overload1]$$$isEnabled -->
<h3 class="fn"><a name="isEnabled"></a><span class="type">bool</span> Q3Accel::<span class="name">isEnabled</span> () const</h3>
<p>Returns true if the accelerator is enabled; otherwise returns false.</p>
<p><b>See also </b><a href="q3accel.html#setEnabled">setEnabled</a>() and <a href="q3accel.html#isItemEnabled">isItemEnabled</a>().</p>
<!-- @@@isEnabled -->
<!-- $$$isItemEnabled[overload1]$$$isItemEnabledint -->
<h3 class="fn"><a name="isItemEnabled"></a><span class="type">bool</span> Q3Accel::<span class="name">isItemEnabled</span> ( <span class="type">int</span> <i>id</i> ) const</h3>
<p>Returns true if the accelerator item with the identifier <i>id</i> is enabled. Returns false if the item is disabled or cannot be found.</p>
<p><b>See also </b><a href="q3accel.html#setItemEnabled">setItemEnabled</a>() and <a href="q3accel.html#isEnabled">isEnabled</a>().</p>
<!-- @@@isItemEnabled -->
<!-- $$$key[overload1]$$$keyint -->
<h3 class="fn"><a name="key"></a><span class="type"><a href="qkeysequence.html">QKeySequence</a></span> Q3Accel::<span class="name">key</span> ( <span class="type">int</span> <i>id</i> )</h3>
<p>Returns the key sequence of the accelerator item with identifier <i>id</i>, or an invalid key sequence (0) if the id cannot be found.</p>
<!-- @@@key -->
<!-- $$$removeItem[overload1]$$$removeItemint -->
<h3 class="fn"><a name="removeItem"></a><span class="type">void</span> Q3Accel::<span class="name">removeItem</span> ( <span class="type">int</span> <i>id</i> )</h3>
<p>Removes the accelerator item with the identifier <i>id</i>.</p>
<!-- @@@removeItem -->
<!-- $$$setEnabled[overload1]$$$setEnabledbool -->
<h3 class="fn"><a name="setEnabled"></a><span class="type">void</span> Q3Accel::<span class="name">setEnabled</span> ( <span class="type">bool</span> <i>enable</i> )</h3>
<p>Enables the accelerator if <i>enable</i> is true, or disables it if <i>enable</i> is false.</p>
<p>Individual keys can also be enabled or disabled using <a href="q3accel.html#setItemEnabled">setItemEnabled</a>(). To work, a key must be an enabled item in an enabled <a href="q3accel.html" class="compat">Q3Accel</a>.</p>
<p><b>See also </b><a href="q3accel.html#isEnabled">isEnabled</a>() and <a href="q3accel.html#setItemEnabled">setItemEnabled</a>().</p>
<!-- @@@setEnabled -->
<!-- $$$setItemEnabled[overload1]$$$setItemEnabledintbool -->
<h3 class="fn"><a name="setItemEnabled"></a><span class="type">void</span> Q3Accel::<span class="name">setItemEnabled</span> ( <span class="type">int</span> <i>id</i>, <span class="type">bool</span> <i>enable</i> )</h3>
<p>Enables the accelerator item with the identifier <i>id</i> if <i>enable</i> is true, and disables item <i>id</i> if <i>enable</i> is false.</p>
<p>To work, an item must be enabled and be in an enabled <a href="q3accel.html" class="compat">Q3Accel</a>.</p>
<p><b>See also </b><a href="q3accel.html#isItemEnabled">isItemEnabled</a>() and <a href="q3accel.html#isEnabled">isEnabled</a>().</p>
<!-- @@@setItemEnabled -->
<!-- $$$setWhatsThis[overload1]$$$setWhatsThisintconstQString& -->
<h3 class="fn"><a name="setWhatsThis"></a><span class="type">void</span> Q3Accel::<span class="name">setWhatsThis</span> ( <span class="type">int</span> <i>id</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>Sets a What's This help text for the accelerator item <i>id</i> to <i>text</i>.</p>
<p>The text will be shown when the application is in What's This mode and the user hits the accelerator key.</p>
<p>To set What's This help on a menu item (with or without an accelerator key), use Q3MenuData::setWhatsThis().</p>
<p><b>See also </b><a href="q3accel.html#whatsThis">whatsThis</a>(), <a href="qwhatsthis.html#inWhatsThisMode">QWhatsThis::inWhatsThisMode</a>(), and <a href="qaction.html#whatsThis-prop">QAction::setWhatsThis</a>().</p>
<!-- @@@setWhatsThis -->
<!-- $$$shortcutKey[overload1]$$$shortcutKeyconstQString& -->
<h3 class="fn"><a name="shortcutKey"></a><span class="type"><a href="qkeysequence.html">QKeySequence</a></span> Q3Accel::<span class="name">shortcutKey</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> )<tt> [static]</tt></h3>
<p>Returns the shortcut key sequence for <i>str</i>, or an invalid key sequence (0) if <i>str</i> has no shortcut sequence.</p>
<p>For example, shortcutKey(&quot;E&amp;xit&quot;) returns <a href="qkeysequence.html">QKeySequence</a>(<a href="qt.html#Modifier-enum">Qt::ALT</a> + <a href="qt.html#Key-enum">Qt::Key_X</a>), shortcutKey(&quot;&amp;Quit&quot;) returns <a href="qkeysequence.html">QKeySequence</a>(<a href="qt.html#Modifier-enum">Qt::ALT</a> + <a href="qt.html#Key-enum">Qt::Key_Q</a>), and shortcutKey(&quot;Quit&quot;) returns QKeySequence().</p>
<!-- @@@shortcutKey -->
<!-- $$$whatsThis[overload1]$$$whatsThisint -->
<h3 class="fn"><a name="whatsThis"></a><span class="type"><a href="qstring.html">QString</a></span> Q3Accel::<span class="name">whatsThis</span> ( <span class="type">int</span> <i>id</i> ) const</h3>
<p>Returns the What's This help text for the specified item <i>id</i> or an empty string if no text has been specified.</p>
<p><b>See also </b><a href="q3accel.html#setWhatsThis">setWhatsThis</a>().</p>
<!-- @@@whatsThis -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>