Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 3271

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- q3action.cpp -->
<head>
  <title>Qt 4.6: Q3Action Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//Q3Action"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">Q3Action Class Reference<br /><span class="small-subtitle">[<a href="qt3support.html">Qt3Support</a> module]</span>
</h1>
<p>The Q3Action class provides an abstract user interface action that can appear both in menus and tool bars. <a href="#details">More...</a></p>
<pre> #include &lt;Q3Action&gt;</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#qaction">Porting to Qt 4</a> for more information.</p>
<p>Inherits <a href="qobject.html">QObject</a>.</p>
<p>Inherited by <a href="q3actiongroup.html">Q3ActionGroup</a>.</p>
<ul>
<li><a href="q3action-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="q3action.html#accel-prop">accel</a></b> : QKeySequence</div></li>
<li><div class="fn"><b><a href="q3action.html#enabled-prop">enabled</a></b> : bool</div></li>
<li><div class="fn"><b><a href="q3action.html#iconSet-prop">iconSet</a></b> : QIcon</div></li>
<li><div class="fn"><b><a href="q3action.html#menuText-prop">menuText</a></b> : QString</div></li>
<li><div class="fn"><b><a href="q3action.html#on-prop">on</a></b> : bool</div></li>
<li><div class="fn"><b><a href="q3action.html#statusTip-prop">statusTip</a></b> : QString</div></li>
</ul></td><td valign="top"><ul>
<li><div class="fn"><b><a href="q3action.html#text-prop">text</a></b> : QString</div></li>
<li><div class="fn"><b><a href="q3action.html#toggleAction-prop">toggleAction</a></b> : bool</div></li>
<li><div class="fn"><b><a href="q3action.html#toolTip-prop">toolTip</a></b> : QString</div></li>
<li><div class="fn"><b><a href="q3action.html#visible-prop">visible</a></b> : bool</div></li>
<li><div class="fn"><b><a href="q3action.html#whatsThis-prop">whatsThis</a></b> : QString</div></li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#Q3Action">Q3Action</a></b> ( QObject * <i>parent</i>, const char * <i>name</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#Q3Action-2">Q3Action</a></b> ( const QString &amp; <i>menuText</i>, QKeySequence <i>accel</i>, QObject * <i>parent</i>, const char * <i>name</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#Q3Action-3">Q3Action</a></b> ( const QIcon &amp; <i>icon</i>, const QString &amp; <i>menuText</i>, QKeySequence <i>accel</i>, QObject * <i>parent</i>, const char * <i>name</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#Q3Action-4">Q3Action</a></b> ( const QString &amp; <i>text</i>, const QIcon &amp; <i>icon</i>, const QString &amp; <i>menuText</i>, QKeySequence <i>accel</i>, QObject * <i>parent</i>, const char * <i>name</i> = 0, bool <i>toggle</i> = false )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#Q3Action-5">Q3Action</a></b> ( const QString &amp; <i>text</i>, const QString &amp; <i>menuText</i>, QKeySequence <i>accel</i>, QObject * <i>parent</i>, const char * <i>name</i> = 0, bool <i>toggle</i> = false )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#Q3Action-6">Q3Action</a></b> ( QObject * <i>parent</i>, const char * <i>name</i>, bool <i>toggle</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#dtor.Q3Action">~Q3Action</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QKeySequence </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#accel-prop">accel</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#addTo">addTo</a></b> ( QWidget * <i>w</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QIcon </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#iconSet-prop">iconSet</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#enabled-prop">isEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#on-prop">isOn</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#toggleAction-prop">isToggleAction</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#visible-prop">isVisible</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#menuText-prop">menuText</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#removeFrom">removeFrom</a></b> ( QWidget * <i>w</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#accel-prop">setAccel</a></b> ( const QKeySequence &amp; <i>key</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#iconSet-prop">setIconSet</a></b> ( const QIcon &amp; )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#menuText-prop">setMenuText</a></b> ( const QString &amp; )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#statusTip-prop">setStatusTip</a></b> ( const QString &amp; )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#text-prop">setText</a></b> ( const QString &amp; )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#toggleAction-prop">setToggleAction</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#toolTip-prop">setToolTip</a></b> ( const QString &amp; )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#whatsThis-prop">setWhatsThis</a></b> ( const QString &amp; )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#statusTip-prop">statusTip</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#text-prop">text</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#toolTip-prop">toolTip</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#whatsThis-prop">whatsThis</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#activate">activate</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#setDisabled">setDisabled</a></b> ( bool <i>disable</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#enabled-prop">setEnabled</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#on-prop">setOn</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#visible-prop">setVisible</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#toggle">toggle</a></b> ()</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#activated">activated</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#toggled">toggled</a></b> ( bool <i>on</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<hr />
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#addedTo">addedTo</a></b> ( QWidget * <i>actionWidget</i>, QWidget * <i>container</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3action.html#addedTo-2">addedTo</a></b> ( int <i>index</i>, Q3PopupMenu * <i>menu</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The Q3Action class provides an abstract user interface action that can appear both in menus and tool bars.</p>
<p>In GUI applications many commands can be invoked via a menu option, a toolbar button and a keyboard accelerator. Since the same action must be performed regardless of how the action was invoked, and since the menu and toolbar should be kept in sync, it is useful to represent a command as an <i>action</i>. An action can be added to a menu and a toolbar and will automatically keep them in sync. For example, if the user presses a Bold toolbar button the Bold menu item will automatically be checked.</p>
<p>A Q3Action may contain an icon, a menu text, an accelerator, a status text, a &quot;What's This?&quot; text and a tool tip. Most of these can be set in the constructor. They can also be set independently with <a href="q3action.html#iconSet-prop">setIconSet</a>(), <a href="q3action.html#text-prop">setText</a>(), <a href="q3action.html#menuText-prop">setMenuText</a>(), <a href="q3action.html#toolTip-prop">setToolTip</a>(), <a href="q3action.html#statusTip-prop">setStatusTip</a>(), <a href="q3action.html#whatsThis-prop">setWhatsThis</a>() and <a href="q3action.html#accel-prop">setAccel</a>().</p>
<p>An action may be a toggle action e.g&#x2e; a Bold toolbar button, or a command action, e.g&#x2e; 'Open File' to invoke an open file dialog. Toggle actions emit the <a href="q3action.html#toggled">toggled</a>() signal when their state changes. Both command and toggle actions emit the <a href="q3action.html#activated">activated</a>() signal when they are invoked. Use <a href="q3action.html#toggleAction-prop">setToggleAction</a>() to set an action's toggled status. To see if an action is a toggle action use <a href="q3action.html#toggleAction-prop">isToggleAction</a>(). A toggle action may be &quot;on&quot;, <a href="q3action.html#on-prop">isOn</a>() returns true, or &quot;off&quot;, <a href="q3action.html#on-prop">isOn</a>() returns false.</p>
<p>Actions are added to widgets (menus or toolbars) using <a href="q3action.html#addTo">addTo</a>(), and removed using <a href="q3action.html#removeFrom">removeFrom</a>(). Note that when using <a href="q3toolbar.html">Q3ToolBar</a> and <a href="q3popupmenu.html">Q3PopupMenu</a>, their actions must be Q3Actions.</p>
<p>Once a Q3Action has been created it should be added to the relevant menu and toolbar and then connected to the slot which will perform the action.</p>
<p>We recommend that actions are created as children of the window that they are used in. In most cases actions will be children of the application's main window.</p>
<p>To prevent recursion, don't create an action as a child of a widget that the action is later added to.</p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/Q3Action/accel"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setAccel"></a>
<h3 class="fn"><a name="accel-prop"></a>accel : <a href="qkeysequence.html">QKeySequence</a></h3>
<p>This property holds the action's accelerator key.</p>
<p>The keycodes can be found in <a href="qt.html#Key-enum">Qt::Key</a> and <a href="qt.html#Modifier-enum">Qt::Modifier</a>. There is no default accelerator key.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QKeySequence </td><td class="memItemRight" valign="bottom"><b>accel</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setAccel</b> ( const QKeySequence &amp; <i>key</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3Action/isEnabled"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setEnabled"></a>
<h3 class="fn"><a name="enabled-prop"></a>enabled : bool</h3>
<p>This property holds whether the action is enabled.</p>
<p>Disabled actions can't be chosen by the user. They don't disappear from the menu/tool bar but are displayed in a way which indicates that they are unavailable, e.g&#x2e; they might be displayed grayed out.</p>
<p>What's this? help on disabled actions is still available provided the <a href="q3action.html#whatsThis-prop">Q3Action::whatsThis</a> property is set.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>isEnabled</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setEnabled</b> ( bool )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3Action/iconSet"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setIconSet"></a>
<h3 class="fn"><a name="iconSet-prop"></a>iconSet : <a href="qicon.html">QIcon</a></h3>
<p>This property holds the action's icon.</p>
<p>The icon is used as the tool button icon and in the menu to the left of the menu text. There is no default icon.</p>
<p>If a null icon (<a href="qicon.html#isNull">QIcon::isNull</a>() is passed into this function, the icon of the action is cleared.</p>
<p>(See the action/toggleaction/toggleaction.cpp example.)</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QIcon </td><td class="memItemRight" valign="bottom"><b>iconSet</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setIconSet</b> ( const QIcon &amp; )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3Action/menuText"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setMenuText"></a>
<h3 class="fn"><a name="menuText-prop"></a>menuText : <a href="qstring.html">QString</a></h3>
<p>This property holds the action's menu text.</p>
<p>If the action is added to a menu the menu option will consist of the icon (if there is one), the menu text and the accelerator (if there is one). If the menu text is not explicitly set in the constructor or by using setMenuText() the action's description text will be used as the menu text. There is no default menu text.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>menuText</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setMenuText</b> ( const QString &amp; )</td></tr>
</table>
<p>See also <a href="q3action.html#text-prop">text</a>.</p>
<a name="//apple_ref/cpp/instm/Q3Action/isOn"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setOn"></a>
<h3 class="fn"><a name="on-prop"></a>on : bool</h3>
<p>This property holds whether a toggle action is on.</p>
<p>This property is always on (true) for command actions and <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a>s; setOn() has no effect on them. For action's where <a href="q3action.html#toggleAction-prop">isToggleAction</a>() is true, this property's default value is off (false).</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>isOn</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setOn</b> ( bool )</td></tr>
</table>
<p>See also <a href="q3action.html#toggleAction-prop">toggleAction</a>.</p>
<a name="//apple_ref/cpp/instm/Q3Action/statusTip"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setStatusTip"></a>
<h3 class="fn"><a name="statusTip-prop"></a>statusTip : <a href="qstring.html">QString</a></h3>
<p>This property holds the action's status tip.</p>
<p>The statusTip is displayed on all status bars that this action's top-level parent widget provides.</p>
<p>If no status tip is defined, the action uses the tool tip text.</p>
<p>There is no default statusTip text.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>statusTip</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setStatusTip</b> ( const QString &amp; )</td></tr>
</table>
<p>See also <a href="q3action.html#toolTip-prop">setToolTip</a>().</p>
<a name="//apple_ref/cpp/instm/Q3Action/text"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setText"></a>
<h3 class="fn"><a name="text-prop"></a>text : <a href="qstring.html">QString</a></h3>
<p>This property holds the action's descriptive text.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>text</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setText</b> ( const QString &amp; )</td></tr>
</table>
<p>See also <a href="q3action.html#menuText-prop">setMenuText</a>(), <a href="q3action.html#toolTip-prop">setToolTip</a>(), and <a href="q3action.html#statusTip-prop">setStatusTip</a>().</p>
<a name="//apple_ref/cpp/instm/Q3Action/isToggleAction"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setToggleAction"></a>
<h3 class="fn"><a name="toggleAction-prop"></a>toggleAction : bool</h3>
<p>This property holds whether the action is a toggle action.</p>
<p>A toggle action is one which has an on/off state. For example a Bold toolbar button is either on or off. An action which is not a toggle action is a command action; a command action is simply executed, e.g&#x2e; file save. This property's default is false.</p>
<p>In some situations, the state of one toggle action should depend on the state of others. For example, &quot;Left Align&quot;, &quot;Center&quot; and &quot;Right Align&quot; toggle actions are mutually exclusive. To achieve exclusive toggling, add the relevant toggle actions to a <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a> with the <a href="q3actiongroup.html#exclusive-prop">Q3ActionGroup::exclusive</a> property set to true.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>isToggleAction</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setToggleAction</b> ( bool )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3Action/toolTip"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setToolTip"></a>
<h3 class="fn"><a name="toolTip-prop"></a>toolTip : <a href="qstring.html">QString</a></h3>
<p>This property holds the action's tool tip.</p>
<p>This text is used for the tool tip. If no status tip has been set the tool tip will be used for the status tip.</p>
<p>If no tool tip is specified the action's text is used, and if that hasn't been specified the description text is used as the tool tip text.</p>
<p>There is no default tool tip text.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>toolTip</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setToolTip</b> ( const QString &amp; )</td></tr>
</table>
<p>See also <a href="q3action.html#statusTip-prop">setStatusTip</a>() and <a href="q3action.html#accel-prop">setAccel</a>().</p>
<a name="//apple_ref/cpp/instm/Q3Action/isVisible"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setVisible"></a>
<h3 class="fn"><a name="visible-prop"></a>visible : bool</h3>
<p>This property holds whether the action can be seen (e.g. in menus and toolbars).</p>
<p>If <i>visible</i> is true the action can be seen (e.g&#x2e; in menus and toolbars) and chosen by the user; if <i>visible</i> is false the action cannot be seen or chosen by the user.</p>
<p>Actions which are not visible are <i>not</i> grayed out; they do not appear at all.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>isVisible</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setVisible</b> ( bool )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3Action/whatsThis"></a>
<a name="//apple_ref/cpp/instm/Q3Action/setWhatsThis"></a>
<h3 class="fn"><a name="whatsThis-prop"></a>whatsThis : <a href="qstring.html">QString</a></h3>
<p>This property holds the action's "What's This?" help text.</p>
<p>The whats this text is used to provide a brief description of the action. The text may contain rich text (HTML-like tags -- see <a href="porting4.html#qstylesheet">QStyleSheet</a> for the list of supported tags). There is no default &quot;What's This?&quot; text.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>whatsThis</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setWhatsThis</b> ( const QString &amp; )</td></tr>
</table>
<p>See also <a href="qwhatsthis.html">QWhatsThis</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/Q3Action/Q3Action"></a>
<h3 class="fn"><a name="Q3Action"></a>Q3Action::Q3Action ( <a href="qobject.html">QObject</a> * <i>parent</i>, const char * <i>name</i> = 0 )</h3>
<p>Constructs an action called <i>name</i> with parent <i>parent</i>.</p>
<p>If <i>parent</i> is a <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a>, the new action inserts itself into <i>parent</i>.</p>
<p>For accelerators and status tips to work, <i>parent</i> must either be a widget, or an action group whose parent is a widget.</p>
<p><b>Warning:</b> To prevent recursion, don't create an action as a child of a widget that the action is later added to.</p>
<h3 class="fn"><a name="Q3Action-2"></a>Q3Action::Q3Action ( const <a href="qstring.html">QString</a> &amp; <i>menuText</i>, <a href="qkeysequence.html">QKeySequence</a> <i>accel</i>, <a href="qobject.html">QObject</a> * <i>parent</i>, const char * <i>name</i> = 0 )</h3>
<p>This constructor results in an icon-less action with the menu text <i>menuText</i> and keyboard accelerator <i>accel</i>. It is a child of <i>parent</i> and called <i>name</i>.</p>
<p>If <i>parent</i> is a <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a>, the action automatically becomes a member of it.</p>
<p>For accelerators and status tips to work, <i>parent</i> must either be a widget, or an action group whose parent is a widget.</p>
<p>The action uses a stripped version of <i>menuText</i> (e.g&#x2e; &quot;&amp;Menu Option..&#x2e;&quot; becomes &quot;Menu Option&quot;) as descriptive text for tool buttons. You can override this by setting a specific description with <a href="q3action.html#text-prop">setText</a>(). The same text and <i>accel</i> will be used for tool tips and status tips unless you provide text for these using <a href="q3action.html#toolTip-prop">setToolTip</a>() and <a href="q3action.html#statusTip-prop">setStatusTip</a>().</p>
<p>Call setToggleAction(true) to make the action a toggle action.</p>
<p><b>Warning:</b> To prevent recursion, don't create an action as a child of a widget that the action is later added to.</p>
<h3 class="fn"><a name="Q3Action-3"></a>Q3Action::Q3Action ( const <a href="qicon.html">QIcon</a> &amp; <i>icon</i>, const <a href="qstring.html">QString</a> &amp; <i>menuText</i>, <a href="qkeysequence.html">QKeySequence</a> <i>accel</i>, <a href="qobject.html">QObject</a> * <i>parent</i>, const char * <i>name</i> = 0 )</h3>
<p>This constructor creates an action with the following properties: the icon or icon <i>icon</i>, the menu text <i>menuText</i> and keyboard accelerator <i>accel</i>. It is a child of <i>parent</i> and called <i>name</i>.</p>
<p>If <i>parent</i> is a <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a>, the action automatically becomes a member of it.</p>
<p>For accelerators and status tips to work, <i>parent</i> must either be a widget, or an action group whose parent is a widget.</p>
<p>The action uses a stripped version of <i>menuText</i> (e.g&#x2e; &quot;&amp;Menu Option..&#x2e;&quot; becomes &quot;Menu Option&quot;) as descriptive text for tool buttons. You can override this by setting a specific description with <a href="q3action.html#text-prop">setText</a>(). The same text and <i>accel</i> will be used for tool tips and status tips unless you provide text for these using <a href="q3action.html#toolTip-prop">setToolTip</a>() and <a href="q3action.html#statusTip-prop">setStatusTip</a>().</p>
<p>Call setToggleAction(true) to make the action a toggle action.</p>
<p><b>Warning:</b> To prevent recursion, don't create an action as a child of a widget that the action is later added to.</p>
<h3 class="fn"><a name="Q3Action-4"></a>Q3Action::Q3Action ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, const <a href="qicon.html">QIcon</a> &amp; <i>icon</i>, const <a href="qstring.html">QString</a> &amp; <i>menuText</i>, <a href="qkeysequence.html">QKeySequence</a> <i>accel</i>, <a href="qobject.html">QObject</a> * <i>parent</i>, const char * <i>name</i> = 0, bool <i>toggle</i> = false )</h3>
<p>This constructor creates an action with the following properties: the description <i>text</i>, the icon or icon <i>icon</i>, the menu text <i>menuText</i> and keyboard accelerator <i>accel</i>. It is a child of <i>parent</i> and called <i>name</i>. If <i>toggle</i> is true the action will be a toggle action, otherwise it will be a command action.</p>
<p>If <i>parent</i> is a <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a>, the action automatically becomes a member of it.</p>
<p>For accelerators and status tips to work, <i>parent</i> must either be a widget, or an action group whose parent is a widget.</p>
<p>The <i>text</i> and <i>accel</i> will be used for tool tips and status tips unless you provide specific text for these using <a href="q3action.html#toolTip-prop">setToolTip</a>() and <a href="q3action.html#statusTip-prop">setStatusTip</a>().</p>
<h3 class="fn"><a name="Q3Action-5"></a>Q3Action::Q3Action ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, const <a href="qstring.html">QString</a> &amp; <i>menuText</i>, <a href="qkeysequence.html">QKeySequence</a> <i>accel</i>, <a href="qobject.html">QObject</a> * <i>parent</i>, const char * <i>name</i> = 0, bool <i>toggle</i> = false )</h3>
<p>This constructor results in an icon-less action with the description <i>text</i>, the menu text <i>menuText</i> and the keyboard accelerator <i>accel</i>. Its parent is <i>parent</i> and it is called <i>name</i>. If <i>toggle</i> is true the action will be a toggle action, otherwise it will be a command action.</p>
<p>The action automatically becomes a member of <i>parent</i> if <i>parent</i> is a <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a>.</p>
<p>For accelerators and status tips to work, <i>parent</i> must either be a widget, or an action group whose parent is a widget.</p>
<p>The <i>text</i> and <i>accel</i> will be used for tool tips and status tips unless you provide specific text for these using <a href="q3action.html#toolTip-prop">setToolTip</a>() and <a href="q3action.html#statusTip-prop">setStatusTip</a>().</p>
<h3 class="fn"><a name="Q3Action-6"></a>Q3Action::Q3Action ( <a href="qobject.html">QObject</a> * <i>parent</i>, const char * <i>name</i>, bool <i>toggle</i> )</h3>
<p>Constructs an action called <i>name</i> with parent <i>parent</i>.</p>
<p>If <i>toggle</i> is true the action will be a toggle action, otherwise it will be a command action.</p>
<p>If <i>parent</i> is a <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a>, the new action inserts itself into <i>parent</i>.</p>
<p>For accelerators and status tips to work, <i>parent</i> must either be a widget, or an action group whose parent is a widget.</p>
<a name="//apple_ref/cpp/instm/Q3Action/~Q3Action"></a>
<h3 class="fn"><a name="dtor.Q3Action"></a>Q3Action::~Q3Action ()</h3>
<p>Destroys the object and frees allocated resources.</p>
<a name="//apple_ref/cpp/instm/Q3Action/activate"></a>
<h3 class="fn"><a name="activate"></a>void Q3Action::activate ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Activates the action and executes all connected slots. This only works for actions that are not toggle actions.</p>
<p>See also <a href="q3action.html#toggle">toggle</a>().</p>
<a name="//apple_ref/cpp/instm/Q3Action/activated"></a>
<h3 class="fn"><a name="activated"></a>void Q3Action::activated ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when an action is activated by the user, e.g&#x2e; when the user clicks a menu option or a toolbar button or presses an action's accelerator key combination.</p>
<p>Connect to this signal for command actions. Connect to the <a href="q3action.html#toggled">toggled</a>() signal for toggle actions.</p>
<a name="//apple_ref/cpp/instm/Q3Action/addTo"></a>
<h3 class="fn"><a name="addTo"></a>bool Q3Action::addTo ( <a href="qwidget.html">QWidget</a> * <i>w</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Adds this action to widget <i>w</i>.</p>
<p>Currently actions may be added to <a href="q3toolbar.html" class="compat">Q3ToolBar</a> and <a href="q3popupmenu.html" class="compat">Q3PopupMenu</a> widgets.</p>
<p>An action added to a tool bar is automatically displayed as a tool button; an action added to a pop up menu appears as a menu option.</p>
<p>addTo() returns true if the action was added successfully and false otherwise. (If <i>w</i> is not a <a href="q3toolbar.html" class="compat">Q3ToolBar</a> or <a href="q3popupmenu.html" class="compat">Q3PopupMenu</a> the action will not be added and false will be returned.)</p>
<p>See also <a href="q3action.html#removeFrom">removeFrom</a>().</p>
<a name="//apple_ref/cpp/instm/Q3Action/addedTo"></a>
<h3 class="fn"><a name="addedTo"></a>void Q3Action::addedTo ( <a href="qwidget.html">QWidget</a> * <i>actionWidget</i>, <a href="qwidget.html">QWidget</a> * <i>container</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This function is called from the <a href="q3action.html#addTo">addTo</a>() function when it has created a widget (<i>actionWidget</i>) for the action in the <i>container</i>.</p>
<h3 class="fn"><a name="addedTo-2"></a>void Q3Action::addedTo ( int <i>index</i>, <a href="q3popupmenu.html">Q3PopupMenu</a> * <i>menu</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This is an overloaded function.</p>
<p>This function is called from the <a href="q3action.html#addTo">addTo</a>() function when it has created a menu item at the index position <i>index</i> in the popup menu <i>menu</i>.</p>
<a name="//apple_ref/cpp/instm/Q3Action/removeFrom"></a>
<h3 class="fn"><a name="removeFrom"></a>bool Q3Action::removeFrom ( <a href="qwidget.html">QWidget</a> * <i>w</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Removes the action from widget <i>w</i>.</p>
<p>Returns true if the action was removed successfully; otherwise returns false.</p>
<p>See also <a href="q3action.html#addTo">addTo</a>().</p>
<a name="//apple_ref/cpp/instm/Q3Action/setDisabled"></a>
<h3 class="fn"><a name="setDisabled"></a>void Q3Action::setDisabled ( bool <i>disable</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Disables the action if <i>disable</i> is true; otherwise enables the action.</p>
<p>See the <a href="q3action.html#enabled-prop">enabled</a> documentation for more information.</p>
<a name="//apple_ref/cpp/instm/Q3Action/toggle"></a>
<h3 class="fn"><a name="toggle"></a>void Q3Action::toggle ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Toggles the state of a toggle action.</p>
<p>See also <a href="q3action.html#on-prop">on</a>, <a href="q3action.html#activate">activate</a>(), <a href="q3action.html#toggled">toggled</a>(), and <a href="q3action.html#toggleAction-prop">isToggleAction</a>().</p>
<a name="//apple_ref/cpp/instm/Q3Action/toggled"></a>
<h3 class="fn"><a name="toggled"></a>void Q3Action::toggled ( bool <i>on</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when a toggle action changes state; command actions and <a href="q3actiongroup.html" class="compat">Q3ActionGroup</a>s don't emit toggled().</p>
<p>The <i>on</i> argument denotes the new state: If <i>on</i> is true the toggle action is switched on, and if <i>on</i> is false the toggle action is switched off.</p>
<p>To trigger a user command depending on whether a toggle action has been switched on or off connect it to a slot that takes a bool to indicate the state.</p>
<p>See also <a href="q3action.html#activated">activated</a>(), <a href="q3action.html#toggleAction-prop">setToggleAction</a>(), and <a href="q3action.html#on-prop">setOn</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>