Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3223

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qaction.cpp -->
  <title>QAction Class | Qt Widgets 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QAction</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QAction Class</h1>
<!-- $$$QAction-brief -->
<p>The <a href="qaction.html">QAction</a> class provides an abstract user interface action that can be inserted into widgets. <a href="#details">More...</a></p>
<!-- @@@QAction -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QAction&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qwidgetaction.html">QWidgetAction</a></p>
</td></tr></table></div><ul>
<li><a href="qaction-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#ActionEvent-enum">ActionEvent</a></b> { Trigger, Hover }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#MenuRole-enum">MenuRole</a></b> { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, ..., QuitRole }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#Priority-enum">Priority</a></b> { LowPriority, NormalPriority, HighPriority }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qaction.html#autoRepeat-prop">autoRepeat</a></b> : bool</li>
<li class="fn"><b><a href="qaction.html#checkable-prop">checkable</a></b> : bool</li>
<li class="fn"><b><a href="qaction.html#checked-prop">checked</a></b> : bool</li>
<li class="fn"><b><a href="qaction.html#enabled-prop">enabled</a></b> : bool</li>
<li class="fn"><b><a href="qaction.html#font-prop">font</a></b> : QFont</li>
<li class="fn"><b><a href="qaction.html#icon-prop">icon</a></b> : QIcon</li>
<li class="fn"><b><a href="qaction.html#iconText-prop">iconText</a></b> : QString</li>
<li class="fn"><b><a href="qaction.html#iconVisibleInMenu-prop">iconVisibleInMenu</a></b> : bool</li>
<li class="fn"><b><a href="qaction.html#menuRole-prop">menuRole</a></b> : MenuRole</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qaction.html#priority-prop">priority</a></b> : Priority</li>
<li class="fn"><b><a href="qaction.html#shortcut-prop">shortcut</a></b> : QKeySequence</li>
<li class="fn"><b><a href="qaction.html#shortcutContext-prop">shortcutContext</a></b> : Qt::ShortcutContext</li>
<li class="fn"><b><a href="qaction.html#statusTip-prop">statusTip</a></b> : QString</li>
<li class="fn"><b><a href="qaction.html#text-prop">text</a></b> : QString</li>
<li class="fn"><b><a href="qaction.html#toolTip-prop">toolTip</a></b> : QString</li>
<li class="fn"><b><a href="qaction.html#visible-prop">visible</a></b> : bool</li>
<li class="fn"><b><a href="qaction.html#whatsThis-prop">whatsThis</a></b> : QString</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#QAction">QAction</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#QAction-1">QAction</a></b>(const QString &amp;<i>text</i>, QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#QAction-2">QAction</a></b>(const QIcon &amp;<i>icon</i>, const QString &amp;<i>text</i>, QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#dtor.QAction">~QAction</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QActionGroup *</td><td class="memItemRight bottomAlign"><b><a href="qaction.html#actionGroup">actionGroup</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#activate">activate</a></b>(ActionEvent <i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsWidget *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#associatedGraphicsWidgets">associatedGraphicsWidgets</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QWidget *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#associatedWidgets">associatedWidgets</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#autoRepeat-prop">autoRepeat</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#data">data</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#font-prop">font</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#icon-prop">icon</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#iconText-prop">iconText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#checkable-prop">isCheckable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#checked-prop">isChecked</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#enabled-prop">isEnabled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#iconVisibleInMenu-prop">isIconVisibleInMenu</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#isSeparator">isSeparator</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#visible-prop">isVisible</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu *</td><td class="memItemRight bottomAlign"><b><a href="qaction.html#menu">menu</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> MenuRole </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#menuRole-prop">menuRole</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qaction.html#parentWidget">parentWidget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Priority </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#priority-prop">priority</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#setActionGroup">setActionGroup</a></b>(QActionGroup *<i>group</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#autoRepeat-prop">setAutoRepeat</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#checkable-prop">setCheckable</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#setData">setData</a></b>(const QVariant &amp;<i>userData</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#font-prop">setFont</a></b>(const QFont &amp;<i>font</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#icon-prop">setIcon</a></b>(const QIcon &amp;<i>icon</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#iconText-prop">setIconText</a></b>(const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#iconVisibleInMenu-prop">setIconVisibleInMenu</a></b>(bool <i>visible</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#setMenu">setMenu</a></b>(QMenu *<i>menu</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#menuRole-prop">setMenuRole</a></b>(MenuRole <i>menuRole</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#priority-prop">setPriority</a></b>(Priority <i>priority</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#setSeparator">setSeparator</a></b>(bool <i>b</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#shortcut-prop">setShortcut</a></b>(const QKeySequence &amp;<i>shortcut</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#shortcutContext-prop">setShortcutContext</a></b>(Qt::ShortcutContext <i>context</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#setShortcuts">setShortcuts</a></b>(const QList&lt;QKeySequence&gt; &amp;<i>shortcuts</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#setShortcuts-1">setShortcuts</a></b>(QKeySequence::StandardKey <i>key</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#statusTip-prop">setStatusTip</a></b>(const QString &amp;<i>statusTip</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#text-prop">setText</a></b>(const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#toolTip-prop">setToolTip</a></b>(const QString &amp;<i>tip</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#whatsThis-prop">setWhatsThis</a></b>(const QString &amp;<i>what</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QKeySequence </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#shortcut">shortcut</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::ShortcutContext </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#shortcutContext-prop">shortcutContext</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QKeySequence&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#shortcuts">shortcuts</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#showStatusText">showStatusText</a></b>(QWidget *<i>widget</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#statusTip-prop">statusTip</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#text-prop">text</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#toolTip-prop">toolTip</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#whatsThis-prop">whatsThis</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#hover">hover</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#checked-prop">setChecked</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#setDisabled">setDisabled</a></b>(bool <i>b</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#enabled-prop">setEnabled</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#visible-prop">setVisible</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#toggle">toggle</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#trigger">trigger</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#changed">changed</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#hovered">hovered</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#toggled">toggled</a></b>(bool <i>checked</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#triggered">triggered</a></b>(bool <i>checked</i> = false)</td></tr>
</table></div>
<ul>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qaction.html#event">event</a></b>(QEvent *<i>e</i>)</td></tr>
</table></div>
<ul>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QAction-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qaction.html">QAction</a> class provides an abstract user interface action that can be inserted into widgets.</p>
<p>In applications many common commands can be invoked via menus, toolbar buttons, and keyboard shortcuts. Since the user expects each command to be performed in the same way, regardless of the user interface used, it is useful to represent each command as an <i>action</i>.</p>
<p>Actions can be added to menus and toolbars, and will automatically keep them in sync. For example, in a word processor, if the user presses a Bold toolbar button, the Bold menu item will automatically be checked.</p>
<p>Actions can be created as independent objects, but they may also be created during the construction of menus; the <a href="qmenu.html">QMenu</a> class contains convenience functions for creating actions suitable for use as menu items.</p>
<p>A <a href="qaction.html">QAction</a> may contain an icon, menu text, a shortcut, status text, &quot;What's This?&quot; text, and a tooltip. Most of these can be set in the constructor. They can also be set independently with <a href="qaction.html#icon-prop">setIcon</a>(), <a href="qaction.html#text-prop">setText</a>(), <a href="qaction.html#iconText-prop">setIconText</a>(), <a href="qaction.html#shortcut-prop">setShortcut</a>(), <a href="qaction.html#statusTip-prop">setStatusTip</a>(), <a href="qaction.html#whatsThis-prop">setWhatsThis</a>(), and <a href="qaction.html#toolTip-prop">setToolTip</a>(). For menu items, it is possible to set an individual font with <a href="qaction.html#font-prop">setFont</a>().</p>
<p>Actions are added to widgets using <a href="qwidget.html#addAction">QWidget::addAction</a>() or <a href="qgraphicswidget.html#addAction">QGraphicsWidget::addAction</a>(). Note that an action must be added to a widget before it can be used; this is also true when the shortcut should be global (i.e&#x2e;, <a href="../qtcore/qt.html#ShortcutContext-enum">Qt::ApplicationShortcut</a> as <a href="../qtcore/qt.html#ShortcutContext-enum">Qt::ShortcutContext</a>).</p>
<p>Once a <a href="qaction.html">QAction</a> has been created it should be added to the relevant menu and toolbar, then connected to the slot which will perform the action. For example:</p>
<pre class="cpp">

      <span class="keyword">const</span> <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> openIcon <span class="operator">=</span> <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span><span class="operator">::</span>fromTheme(<span class="string">&quot;document-open&quot;</span><span class="operator">,</span> <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span>(<span class="string">&quot;:/images/open.png&quot;</span>));
      <span class="type"><a href="qaction.html#QAction">QAction</a></span> <span class="operator">*</span>openAct <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qaction.html#QAction">QAction</a></span>(openIcon<span class="operator">,</span> tr(<span class="string">&quot;&amp;Open...&quot;</span>)<span class="operator">,</span> <span class="keyword">this</span>);
      openAct<span class="operator">-</span><span class="operator">&gt;</span>setShortcuts(<span class="type"><a href="../qtgui/qkeysequence.html">QKeySequence</a></span><span class="operator">::</span>Open);
      openAct<span class="operator">-</span><span class="operator">&gt;</span>setStatusTip(tr(<span class="string">&quot;Open an existing file&quot;</span>));
      connect(openAct<span class="operator">,</span> <span class="operator">&amp;</span><span class="type"><a href="qaction.html#QAction">QAction</a></span><span class="operator">::</span>triggered<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> <span class="operator">&amp;</span>MainWindow<span class="operator">::</span>open);
      fileMenu<span class="operator">-</span><span class="operator">&gt;</span>addAction(openAct);
      fileToolBar<span class="operator">-</span><span class="operator">&gt;</span>addAction(openAct);

</pre>
<pre class="cpp">

  fileMenu<span class="operator">-</span><span class="operator">&gt;</span>addAction(openAct);

</pre>
<p>We recommend that actions are created as children of the window they are used in. In most cases actions will be children of the application's main window.</p>
</div>
<p><b>See also </b><a href="qmenu.html">QMenu</a>, <a href="qtoolbar.html">QToolBar</a>, and <a href="qtwidgets-mainwindows-application-example.html">Application Example</a>.</p>
<!-- @@@QAction -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ActionEvent$$$Trigger$$$Hover -->
<h3 class="fn" id="ActionEvent-enum"><a name="ActionEvent-enum"></a>enum QAction::<span class="name">ActionEvent</span></h3>
<p>This enum type is used when calling <a href="qaction.html#activate">QAction::activate</a>()</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QAction::Trigger</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">this will cause the <a href="qaction.html#triggered">QAction::triggered</a>() signal to be emitted.</td></tr>
<tr><td class="topAlign"><code>QAction::Hover</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">this will cause the <a href="qaction.html#hovered">QAction::hovered</a>() signal to be emitted.</td></tr>
</table></div>
<!-- @@@ActionEvent -->
<!-- $$$MenuRole$$$NoRole$$$TextHeuristicRole$$$ApplicationSpecificRole$$$AboutQtRole$$$AboutRole$$$PreferencesRole$$$QuitRole -->
<h3 class="fn" id="MenuRole-enum"><a name="MenuRole-enum"></a>enum QAction::<span class="name">MenuRole</span></h3>
<p>This enum describes how an action should be moved into the application menu on macOS.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QAction::NoRole</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">This action should not be put into the application menu</td></tr>
<tr><td class="topAlign"><code>QAction::TextHeuristicRole</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">This action should be put in the application menu based on the action's text as described in the <a href="qmenubar.html">QMenuBar</a> documentation.</td></tr>
<tr><td class="topAlign"><code>QAction::ApplicationSpecificRole</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">This action should be put in the application menu with an application specific role</td></tr>
<tr><td class="topAlign"><code>QAction::AboutQtRole</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">This action handles the &quot;About Qt&quot; menu item.</td></tr>
<tr><td class="topAlign"><code>QAction::AboutRole</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">This action should be placed where the &quot;About&quot; menu item is in the application menu. The text of the menu item will be set to &quot;About &lt;application name&gt;&quot;. The application name is fetched from the <code>Info.plist</code> file in the application's bundle (See Qt for macOS - Deployment).</td></tr>
<tr><td class="topAlign"><code>QAction::PreferencesRole</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">This action should be placed where the &quot;Preferences..&#x2e;&quot; menu item is in the application menu.</td></tr>
<tr><td class="topAlign"><code>QAction::QuitRole</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">This action should be placed where the Quit menu item is in the application menu.</td></tr>
</table></div>
<p>Setting this value only has effect on items that are in the immediate menus of the menubar, not the submenus of those menus. For example, if you have File menu in your menubar and the File menu has a submenu, setting the MenuRole for the actions in that submenu have no effect. They will never be moved.</p>
<!-- @@@MenuRole -->
<!-- $$$Priority$$$LowPriority$$$NormalPriority$$$HighPriority -->
<h3 class="fn" id="Priority-enum"><a name="Priority-enum"></a>enum QAction::<span class="name">Priority</span></h3>
<p>This enum defines priorities for actions in user interface.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QAction::LowPriority</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The action should not be prioritized in the user interface.</td></tr>
<tr><td class="topAlign"><code>QAction::NormalPriority</code></td><td class="topAlign tblval"><code>128</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QAction::HighPriority</code></td><td class="topAlign tblval"><code>256</code></td><td class="topAlign">The action should be prioritized in the user interface.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 4.6.</p>
<p><b>See also </b><a href="qaction.html#priority-prop">priority</a>.</p>
<!-- @@@Priority -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$autoRepeat-prop$$$autoRepeat$$$setAutoRepeatbool$$$changed -->
<h3 class="fn" id="autoRepeat-prop"><a name="autoRepeat-prop"></a><span class="name">autoRepeat</span> : <span class="type">bool</span></h3>
<p>This property holds whether the action can auto repeat</p>
<p>If true, the action will auto repeat when the keyboard shortcut combination is held down, provided that keyboard auto repeat is enabled on the system. The default value is true.</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>autoRepeat</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoRepeat</b></span>(<i>bool</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<!-- @@@autoRepeat -->
<!-- $$$checkable-prop$$$isCheckable$$$setCheckablebool$$$changed -->
<h3 class="fn" id="checkable-prop"><a name="checkable-prop"></a><span class="name">checkable</span> : <span class="type">bool</span></h3>
<p>This property holds whether the action is a checkable action</p>
<p>A checkable action is one which has an on/off state. For example, in a word processor, a Bold toolbar button may be 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. By default, this property is <code>false</code>.</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="qactiongroup.html">QActionGroup</a> with the <a href="qactiongroup.html#exclusive-prop">QActionGroup::exclusive</a> property set to true.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isCheckable</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCheckable</b></span>(<i>bool</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#checked-prop">QAction::setChecked</a>().</p>
<!-- @@@checkable -->
<!-- $$$checked-prop$$$isChecked$$$setCheckedbool$$$toggledbool -->
<h3 class="fn" id="checked-prop"><a name="checked-prop"></a><span class="name">checked</span> : <span class="type">bool</span></h3>
<p>This property holds whether the action is checked.</p>
<p>Only checkable actions can be checked. By default, this is false (the action is unchecked).</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isChecked</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setChecked</b></span>(<i>bool</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#toggled">toggled</a></b></span>(bool <i>checked</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#checkable-prop">checkable</a>.</p>
<!-- @@@checked -->
<!-- $$$enabled-prop$$$isEnabled$$$setEnabledbool$$$changed -->
<h3 class="fn" id="enabled-prop"><a name="enabled-prop"></a><span class="name">enabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether the action is enabled</p>
<p>Disabled actions cannot be chosen by the user. They do not disappear from menus or toolbars, but they are displayed in a way which indicates that they are unavailable. For example, they might be displayed using only shades of gray.</p>
<p><b>What's This?</b> help on disabled actions is still available, provided that the <a href="qaction.html#whatsThis-prop">QAction::whatsThis</a> property is set.</p>
<p>An action will be disabled when all widgets to which it is added (with <a href="qwidget.html#addAction">QWidget::addAction</a>()) are disabled or not visible. When an action is disabled, it is not possible to trigger it through its shortcut.</p>
<p>By default, this property is <code>true</code> (actions are enabled).</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isEnabled</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setEnabled</b></span>(<i>bool</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#text-prop">text</a>.</p>
<!-- @@@enabled -->
<!-- $$$font-prop$$$font$$$setFontconstQFont&$$$changed -->
<h3 class="fn" id="font-prop"><a name="font-prop"></a><span class="name">font</span> : <span class="type"><a href="../qtgui/qfont.html">QFont</a></span></h3>
<p>This property holds the action's font</p>
<p>The font property is used to render the text set on the <a href="qaction.html">QAction</a>. The font will can be considered a hint as it will not be consulted in all cases based upon application and style.</p>
<p>By default, this property contains the application's default font.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QFont </td><td class="memItemRight bottomAlign"><span class="name"><b>font</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFont</b></span>(const QFont &amp;<i>font</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#text-prop">QAction::setText</a>() and <a href="qstyle.html">QStyle</a>.</p>
<!-- @@@font -->
<!-- $$$icon-prop$$$icon$$$setIconconstQIcon&$$$changed -->
<h3 class="fn" id="icon-prop"><a name="icon-prop"></a><span class="name">icon</span> : <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span></h3>
<p>This property holds the action's icon</p>
<p>In toolbars, the icon is used as the tool button icon; in menus, it is displayed to the left of the menu text. There is no default icon.</p>
<p>If a null icon (<a href="../qtgui/qicon.html#isNull">QIcon::isNull</a>()) is passed into this function, the icon of the action is cleared.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QIcon </td><td class="memItemRight bottomAlign"><span class="name"><b>icon</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIcon</b></span>(const QIcon &amp;<i>icon</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<!-- @@@icon -->
<!-- $$$iconText-prop$$$iconText$$$setIconTextconstQString&$$$changed -->
<h3 class="fn" id="iconText-prop"><a name="iconText-prop"></a><span class="name">iconText</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the action's descriptive icon text</p>
<p>If <a href="qtoolbar.html#toolButtonStyle-prop">QToolBar::toolButtonStyle</a> is set to a value that permits text to be displayed, the text defined held in this property appears as a label in the relevant tool button.</p>
<p>It also serves as the default text in menus and tooltips if the action has not been defined with <a href="qaction.html#text-prop">setText</a>() or <a href="qaction.html#toolTip-prop">setToolTip</a>(), and will also be used in toolbar buttons if no icon has been defined using <a href="qaction.html#icon-prop">setIcon</a>().</p>
<p>If the icon text is not explicitly set, the action's normal text will be used for the icon text.</p>
<p>By default, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>iconText</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIconText</b></span>(const QString &amp;<i>text</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#toolTip-prop">setToolTip</a>() and <a href="qaction.html#statusTip-prop">setStatusTip</a>().</p>
<!-- @@@iconText -->
<!-- $$$iconVisibleInMenu-prop$$$isIconVisibleInMenu$$$setIconVisibleInMenubool$$$changed -->
<h3 class="fn" id="iconVisibleInMenu-prop"><a name="iconVisibleInMenu-prop"></a><span class="name">iconVisibleInMenu</span> : <span class="type">bool</span></h3>
<p>This property holds whether or not an action should show an icon in a menu</p>
<p>In some applications, it may make sense to have actions with icons in the toolbar, but not in menus. If true, the icon (if valid) is shown in the menu, when it is false, it is not shown.</p>
<p>The default is to follow whether the <a href="../qtcore/qt.html#ApplicationAttribute-enum">Qt::AA_DontShowIconsInMenus</a> attribute is set for the application. Explicitly settings this property overrides the presence (or abscence) of the attribute.</p>
<p>For example:</p>
<pre class="cpp">

  <span class="type"><a href="qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv);
  app<span class="operator">.</span>setAttribute(<span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>AA_DontShowIconsInMenus);  <span class="comment">// Icons are *no longer shown* in menus</span>
  <span class="comment">// ...</span>
  <span class="type"><a href="qaction.html#QAction">QAction</a></span> <span class="operator">*</span>myAction <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qaction.html#QAction">QAction</a></span>();
  <span class="comment">// ...</span>
  myAction<span class="operator">-</span><span class="operator">&gt;</span>setIcon(SomeIcon);
  myAction<span class="operator">-</span><span class="operator">&gt;</span>setIconVisibleInMenu(<span class="keyword">true</span>);   <span class="comment">// Icon *will* be shown in menus for *this* action.</span>

</pre>
<p>This property was introduced in  Qt 4.4.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isIconVisibleInMenu</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIconVisibleInMenu</b></span>(bool <i>visible</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#icon-prop">QAction::icon</a> and <a href="../qtcore/qcoreapplication.html#setAttribute">QCoreApplication::setAttribute</a>().</p>
<!-- @@@iconVisibleInMenu -->
<!-- $$$menuRole-prop$$$menuRole$$$setMenuRoleMenuRole$$$changed -->
<h3 class="fn" id="menuRole-prop"><a name="menuRole-prop"></a><span class="name">menuRole</span> : <span class="type"><a href="qaction.html#MenuRole-enum">MenuRole</a></span></h3>
<p>This property holds the action's menu role</p>
<p>This indicates what role the action serves in the application menu on macOS. By default all actions have the <a href="qaction.html#MenuRole-enum">TextHeuristicRole</a>, which means that the action is added based on its text (see <a href="qmenubar.html">QMenuBar</a> for more information).</p>
<p>The menu role can only be changed before the actions are put into the menu bar in macOS (usually just before the first application window is shown).</p>
<p>This property was introduced in  Qt 4.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> MenuRole </td><td class="memItemRight bottomAlign"><span class="name"><b>menuRole</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMenuRole</b></span>(MenuRole <i>menuRole</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<!-- @@@menuRole -->
<!-- $$$priority-prop$$$priority$$$setPriorityPriority -->
<h3 class="fn" id="priority-prop"><a name="priority-prop"></a><span class="name">priority</span> : <span class="type"><a href="qaction.html#Priority-enum">Priority</a></span></h3>
<p>This property holds the actions's priority in the user interface.</p>
<p>This property can be set to indicate how the action should be prioritized in the user interface.</p>
<p>For instance, when toolbars have the <a href="../qtcore/qt.html#ToolButtonStyle-enum">Qt::ToolButtonTextBesideIcon</a> mode set, then actions with <a href="qaction.html#Priority-enum">LowPriority</a> will not show the text labels.</p>
<p>This property was introduced in  Qt 4.6.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Priority </td><td class="memItemRight bottomAlign"><span class="name"><b>priority</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPriority</b></span>(Priority <i>priority</i>)</td></tr>
</table></div>
<!-- @@@priority -->
<!-- $$$shortcut-prop$$$shortcut$$$setShortcutconstQKeySequence&$$$changed -->
<h3 class="fn" id="shortcut-prop"><a name="shortcut-prop"></a><span class="name">shortcut</span> : <span class="type"><a href="../qtgui/qkeysequence.html">QKeySequence</a></span></h3>
<p>This property holds the action's primary shortcut key</p>
<p>Valid keycodes for this property can be found in <a href="../qtcore/qt.html#Key-enum">Qt::Key</a> and <a href="../qtcore/qt.html#Modifier-enum">Qt::Modifier</a>. There is no default shortcut key.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QKeySequence </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#shortcut">shortcut</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setShortcut</b></span>(const QKeySequence &amp;<i>shortcut</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<!-- @@@shortcut -->
<!-- $$$shortcutContext-prop$$$shortcutContext$$$setShortcutContextQt::ShortcutContext$$$changed -->
<h3 class="fn" id="shortcutContext-prop"><a name="shortcutContext-prop"></a><span class="name">shortcutContext</span> : <span class="type"><a href="../qtcore/qt.html#ShortcutContext-enum">Qt::ShortcutContext</a></span></h3>
<p>This property holds the context for the action's shortcut</p>
<p>Valid values for this property can be found in <a href="../qtcore/qt.html#ShortcutContext-enum">Qt::ShortcutContext</a>. The default value is <a href="../qtcore/qt.html#ShortcutContext-enum">Qt::WindowShortcut</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::ShortcutContext </td><td class="memItemRight bottomAlign"><span class="name"><b>shortcutContext</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setShortcutContext</b></span>(Qt::ShortcutContext <i>context</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<!-- @@@shortcutContext -->
<!-- $$$statusTip-prop$$$statusTip$$$setStatusTipconstQString&$$$changed -->
<h3 class="fn" id="statusTip-prop"><a name="statusTip-prop"></a><span class="name">statusTip</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the action's status tip</p>
<p>The status tip is displayed on all status bars provided by the action's top-level parent widget.</p>
<p>By default, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>statusTip</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setStatusTip</b></span>(const QString &amp;<i>statusTip</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#toolTip-prop">setToolTip</a>() and <a href="qaction.html#showStatusText">showStatusText</a>().</p>
<!-- @@@statusTip -->
<!-- $$$text-prop$$$text$$$setTextconstQString&$$$changed -->
<h3 class="fn" id="text-prop"><a name="text-prop"></a><span class="name">text</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the action's descriptive text</p>
<p>If the action is added to a menu, the menu option will consist of the icon (if there is one), the text, and the shortcut (if there is one). If the text is not explicitly set in the constructor, or by using setText(), the action's description icon text will be used as text. There is no default text.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>text</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setText</b></span>(const QString &amp;<i>text</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#iconText-prop">iconText</a>.</p>
<!-- @@@text -->
<!-- $$$toolTip-prop$$$toolTip$$$setToolTipconstQString&$$$changed -->
<h3 class="fn" id="toolTip-prop"><a name="toolTip-prop"></a><span class="name">toolTip</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the action's tooltip</p>
<p>This text is used for the tooltip. If no tooltip is specified, the action's text is used.</p>
<p>By default, this property contains the action's text.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>toolTip</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setToolTip</b></span>(const QString &amp;<i>tip</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qaction.html#statusTip-prop">setStatusTip</a>() and <a href="qaction.html#shortcut-prop">setShortcut</a>().</p>
<!-- @@@toolTip -->
<!-- $$$visible-prop$$$isVisible$$$setVisiblebool$$$changed -->
<h3 class="fn" id="visible-prop"><a name="visible-prop"></a><span class="name">visible</span> : <span class="type">bool</span></h3>
<p>This property holds whether the action can be seen (e.g&#x2e; 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>By default, this property is <code>true</code> (actions are visible).</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isVisible</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setVisible</b></span>(<i>bool</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<!-- @@@visible -->
<!-- $$$whatsThis-prop$$$whatsThis$$$setWhatsThisconstQString&$$$changed -->
<h3 class="fn" id="whatsThis-prop"><a name="whatsThis-prop"></a><span class="name">whatsThis</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the action's &quot;What's This?&quot; help text</p>
<p>The &quot;What's This?&quot; text is used to provide a brief description of the action. The text may contain rich text. There is no default &quot;What's This?&quot; text.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>whatsThis</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setWhatsThis</b></span>(const QString &amp;<i>what</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qaction.html#changed">changed</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qwhatsthis.html">QWhatsThis</a>.</p>
<!-- @@@whatsThis -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAction[overload1]$$$QActionQObject* -->
<h3 class="fn" id="QAction"><a name="QAction"></a>QAction::<span class="name">QAction</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs an action with <i>parent</i>. If <i>parent</i> is an action group the action will be automatically inserted into the group.</p>
<p><b>Note: </b>The <i>parent</i> argument is optional since Qt 5.7&#x2e;</p><!-- @@@QAction -->
<!-- $$$QAction$$$QActionconstQString&QObject* -->
<h3 class="fn" id="QAction-1"><a name="QAction-1"></a>QAction::<span class="name">QAction</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs an action with some <i>text</i> and <i>parent</i>. If <i>parent</i> is an action group the action will be automatically inserted into the group.</p>
<p>The action uses a stripped version of <i>text</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="qaction.html#text-prop">setText</a>(). The same text will be used for tooltips unless you specify a different text using <a href="qaction.html#toolTip-prop">setToolTip</a>().</p>
<!-- @@@QAction -->
<!-- $$$QAction$$$QActionconstQIcon&constQString&QObject* -->
<h3 class="fn" id="QAction-2"><a name="QAction-2"></a>QAction::<span class="name">QAction</span>(const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs an action with an <i>icon</i> and some <i>text</i> and <i>parent</i>. If <i>parent</i> is an action group the action will be automatically inserted into the group.</p>
<p>The action uses a stripped version of <i>text</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="qaction.html#text-prop">setText</a>(). The same text will be used for tooltips unless you specify a different text using <a href="qaction.html#toolTip-prop">setToolTip</a>().</p>
<!-- @@@QAction -->
<!-- $$$~QAction[overload1]$$$~QAction -->
<h3 class="fn" id="dtor.QAction"><a name="dtor.QAction"></a>QAction::<span class="name">~QAction</span>()</h3>
<p>Destroys the object and frees allocated resources.</p>
<!-- @@@~QAction -->
<!-- $$$actionGroup[overload1]$$$actionGroup -->
<h3 class="fn" id="actionGroup"><a name="actionGroup"></a><span class="type"><a href="qactiongroup.html">QActionGroup</a></span> *QAction::<span class="name">actionGroup</span>() const</h3>
<p>Returns the action group for this action. If no action group manages this action then 0 will be returned.</p>
<p><b>See also </b><a href="qactiongroup.html">QActionGroup</a> and <a href="qaction.html#setActionGroup">QAction::setActionGroup</a>().</p>
<!-- @@@actionGroup -->
<!-- $$$activate[overload1]$$$activateActionEvent -->
<h3 class="fn" id="activate"><a name="activate"></a><span class="type">void</span> QAction::<span class="name">activate</span>(<span class="type"><a href="qaction.html#ActionEvent-enum">ActionEvent</a></span> <i>event</i>)</h3>
<p>Sends the relevant signals for <a href="qaction.html#ActionEvent-enum">ActionEvent</a> <i>event</i>.</p>
<p>Action based widgets use this API to cause the <a href="qaction.html">QAction</a> to emit signals as well as emitting their own.</p>
<!-- @@@activate -->
<!-- $$$associatedGraphicsWidgets[overload1]$$$associatedGraphicsWidgets -->
<h3 class="fn" id="associatedGraphicsWidgets"><a name="associatedGraphicsWidgets"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicswidget.html">QGraphicsWidget</a></span> *&gt; QAction::<span class="name">associatedGraphicsWidgets</span>() const</h3>
<p>Returns a list of widgets this action has been added to.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qwidget.html#addAction">QWidget::addAction</a>() and <a href="qaction.html#associatedWidgets">associatedWidgets</a>().</p>
<!-- @@@associatedGraphicsWidgets -->
<!-- $$$associatedWidgets[overload1]$$$associatedWidgets -->
<h3 class="fn" id="associatedWidgets"><a name="associatedWidgets"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qwidget.html">QWidget</a></span> *&gt; QAction::<span class="name">associatedWidgets</span>() const</h3>
<p>Returns a list of widgets this action has been added to.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qwidget.html#addAction">QWidget::addAction</a>() and <a href="qaction.html#associatedGraphicsWidgets">associatedGraphicsWidgets</a>().</p>
<!-- @@@associatedWidgets -->
<!-- $$$changed -->
<h3 class="fn" id="changed"><a name="changed"></a><code>[signal] </code><span class="type">void</span> QAction::<span class="name">changed</span>()</h3>
<p>This signal is emitted when an action has changed. If you are only interested in actions in a given widget, you can watch for <a href="qwidget.html#actionEvent">QWidget::actionEvent</a>() sent with an <a href="../qtcore/qevent.html#Type-enum">QEvent::ActionChanged</a>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qaction.html#autoRepeat-prop">autoRepeat</a>. Notifier signal for property <a href="qaction.html#checkable-prop">checkable</a>. Notifier signal for property <a href="qaction.html#enabled-prop">enabled</a>. Notifier signal for property <a href="qaction.html#font-prop">font</a>. Notifier signal for property <a href="qaction.html#icon-prop">icon</a>. Notifier signal for property <a href="qaction.html#iconText-prop">iconText</a>. Notifier signal for property <a href="qaction.html#iconVisibleInMenu-prop">iconVisibleInMenu</a>. Notifier signal for property <a href="qaction.html#menuRole-prop">menuRole</a>. Notifier signal for property <a href="qaction.html#shortcut-prop">shortcut</a>. Notifier signal for property <a href="qaction.html#shortcutContext-prop">shortcutContext</a>. Notifier signal for property <a href="qaction.html#statusTip-prop">statusTip</a>. Notifier signal for property <a href="qaction.html#text-prop">text</a>. Notifier signal for property <a href="qaction.html#toolTip-prop">toolTip</a>. Notifier signal for property <a href="qaction.html#visible-prop">visible</a>. Notifier signal for property <a href="qaction.html#whatsThis-prop">whatsThis</a>. </p><p><b>See also </b><a href="qwidget.html#actionEvent">QWidget::actionEvent</a>().</p>
<!-- @@@changed -->
<!-- $$$data[overload1]$$$data -->
<h3 class="fn" id="data"><a name="data"></a><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QAction::<span class="name">data</span>() const</h3>
<p>Returns the user data as set in <a href="qaction.html#setData">QAction::setData</a>.</p>
<p><b>See also </b><a href="qaction.html#setData">setData</a>().</p>
<!-- @@@data -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[virtual protected] </code><span class="type">bool</span> QAction::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$hover[overload1]$$$hover -->
<h3 class="fn" id="hover"><a name="hover"></a><code>[slot] </code><span class="type">void</span> QAction::<span class="name">hover</span>()</h3>
<p>This is a convenience slot that calls activate(Hover).</p>
<!-- @@@hover -->
<!-- $$$hovered[overload1]$$$hovered -->
<h3 class="fn" id="hovered"><a name="hovered"></a><code>[signal] </code><span class="type">void</span> QAction::<span class="name">hovered</span>()</h3>
<p>This signal is emitted when an action is highlighted by the user; for example, when the user pauses with the cursor over a menu option, toolbar button, or presses an action's shortcut key combination.</p>
<p><b>See also </b><a href="qaction.html#activate">QAction::activate</a>().</p>
<!-- @@@hovered -->
<!-- $$$isSeparator[overload1]$$$isSeparator -->
<h3 class="fn" id="isSeparator"><a name="isSeparator"></a><span class="type">bool</span> QAction::<span class="name">isSeparator</span>() const</h3>
<p>Returns <code>true</code> if this action is a separator action; otherwise it returns <code>false</code>.</p>
<p><b>See also </b><a href="qaction.html#setSeparator">QAction::setSeparator</a>().</p>
<!-- @@@isSeparator -->
<!-- $$$menu[overload1]$$$menu -->
<h3 class="fn" id="menu"><a name="menu"></a><span class="type"><a href="qmenu.html">QMenu</a></span> *QAction::<span class="name">menu</span>() const</h3>
<p>Returns the menu contained by this action. Actions that contain menus can be used to create menu items with submenus, or inserted into toolbars to create buttons with popup menus.</p>
<p><b>See also </b><a href="qaction.html#setMenu">setMenu</a>() and <a href="qmenu.html#addAction">QMenu::addAction</a>().</p>
<!-- @@@menu -->
<!-- $$$parentWidget[overload1]$$$parentWidget -->
<h3 class="fn" id="parentWidget"><a name="parentWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> *QAction::<span class="name">parentWidget</span>() const</h3>
<p>Returns the parent widget.</p>
<!-- @@@parentWidget -->
<!-- $$$setActionGroup[overload1]$$$setActionGroupQActionGroup* -->
<h3 class="fn" id="setActionGroup"><a name="setActionGroup"></a><span class="type">void</span> QAction::<span class="name">setActionGroup</span>(<span class="type"><a href="qactiongroup.html">QActionGroup</a></span> *<i>group</i>)</h3>
<p>Sets this action group to <i>group</i>. The action will be automatically added to the group's list of actions.</p>
<p>Actions within the group will be mutually exclusive.</p>
<p><b>See also </b><a href="qactiongroup.html">QActionGroup</a> and <a href="qaction.html#actionGroup">QAction::actionGroup</a>().</p>
<!-- @@@setActionGroup -->
<!-- $$$setData[overload1]$$$setDataconstQVariant& -->
<h3 class="fn" id="setData"><a name="setData"></a><span class="type">void</span> QAction::<span class="name">setData</span>(const <span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> &amp;<i>userData</i>)</h3>
<p>Sets the action's internal data to the given <i>userData</i>.</p>
<p><b>See also </b><a href="qaction.html#data">data</a>().</p>
<!-- @@@setData -->
<!-- $$$setDisabled[overload1]$$$setDisabledbool -->
<h3 class="fn" id="setDisabled"><a name="setDisabled"></a><code>[slot] </code><span class="type">void</span> QAction::<span class="name">setDisabled</span>(<span class="type">bool</span> <i>b</i>)</h3>
<p>This is a convenience function for the <a href="qaction.html#enabled-prop">enabled</a> property, that is useful for signals--slots connections. If <i>b</i> is true the action is disabled; otherwise it is enabled.</p>
<!-- @@@setDisabled -->
<!-- $$$setMenu[overload1]$$$setMenuQMenu* -->
<h3 class="fn" id="setMenu"><a name="setMenu"></a><span class="type">void</span> QAction::<span class="name">setMenu</span>(<span class="type"><a href="qmenu.html">QMenu</a></span> *<i>menu</i>)</h3>
<p>Sets the menu contained by this action to the specified <i>menu</i>.</p>
<p><b>See also </b><a href="qaction.html#menu">menu</a>().</p>
<!-- @@@setMenu -->
<!-- $$$setSeparator[overload1]$$$setSeparatorbool -->
<h3 class="fn" id="setSeparator"><a name="setSeparator"></a><span class="type">void</span> QAction::<span class="name">setSeparator</span>(<span class="type">bool</span> <i>b</i>)</h3>
<p>If <i>b</i> is true then this action will be considered a separator.</p>
<p>How a separator is represented depends on the widget it is inserted into. Under most circumstances the text, submenu, and icon will be ignored for separator actions.</p>
<p><b>See also </b><a href="qaction.html#isSeparator">QAction::isSeparator</a>().</p>
<!-- @@@setSeparator -->
<!-- $$$setShortcuts[overload1]$$$setShortcutsconstQList<QKeySequence>& -->
<h3 class="fn" id="setShortcuts"><a name="setShortcuts"></a><span class="type">void</span> QAction::<span class="name">setShortcuts</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtgui/qkeysequence.html">QKeySequence</a></span>&gt; &amp;<i>shortcuts</i>)</h3>
<p>Sets <i>shortcuts</i> as the list of shortcuts that trigger the action. The first element of the list is the primary shortcut.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qaction.html#shortcuts">shortcuts</a>() and <a href="qaction.html#shortcut-prop">shortcut</a>.</p>
<!-- @@@setShortcuts -->
<!-- $$$setShortcuts$$$setShortcutsQKeySequence::StandardKey -->
<h3 class="fn" id="setShortcuts-1"><a name="setShortcuts-1"></a><span class="type">void</span> QAction::<span class="name">setShortcuts</span>(<span class="type"><a href="../qtgui/qkeysequence.html#StandardKey-enum">QKeySequence::StandardKey</a></span> <i>key</i>)</h3>
<p>Sets a platform dependent list of shortcuts based on the <i>key</i>. The result of calling this function will depend on the currently running platform. Note that more than one shortcut can assigned by this action. If only the primary shortcut is required, use <a href="qaction.html#shortcut-prop">setShortcut</a> instead.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="../qtgui/qkeysequence.html#keyBindings">QKeySequence::keyBindings</a>().</p>
<!-- @@@setShortcuts -->
<!-- $$$shortcut -->
<h3 class="fn" id="shortcut"><a name="shortcut"></a><span class="type"><a href="../qtgui/qkeysequence.html">QKeySequence</a></span> QAction::<span class="name">shortcut</span>() const</h3>
<p>Returns the primary shortcut.</p>
<p><b>Note:</b> Getter function for property <a href="qaction.html#shortcut-prop">shortcut</a>. </p><p><b>See also </b><a href="qaction.html#setShortcuts">setShortcuts</a>().</p>
<!-- @@@shortcut -->
<!-- $$$shortcuts[overload1]$$$shortcuts -->
<h3 class="fn" id="shortcuts"><a name="shortcuts"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtgui/qkeysequence.html">QKeySequence</a></span>&gt; QAction::<span class="name">shortcuts</span>() const</h3>
<p>Returns the list of shortcuts, with the primary shortcut as the first element of the list.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qaction.html#setShortcuts">setShortcuts</a>().</p>
<!-- @@@shortcuts -->
<!-- $$$showStatusText[overload1]$$$showStatusTextQWidget* -->
<h3 class="fn" id="showStatusText"><a name="showStatusText"></a><span class="type">bool</span> QAction::<span class="name">showStatusText</span>(<span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i> = Q_NULLPTR)</h3>
<p>Updates the relevant status bar for the <i>widget</i> specified by sending a <a href="../qtgui/qstatustipevent.html">QStatusTipEvent</a> to its parent widget. Returns <code>true</code> if an event was sent; otherwise returns <code>false</code>.</p>
<p>If a null widget is specified, the event is sent to the action's parent.</p>
<p><b>See also </b><a href="qaction.html#statusTip-prop">statusTip</a>.</p>
<!-- @@@showStatusText -->
<!-- $$$toggle[overload1]$$$toggle -->
<h3 class="fn" id="toggle"><a name="toggle"></a><code>[slot] </code><span class="type">void</span> QAction::<span class="name">toggle</span>()</h3>
<p>This is a convenience function for the <a href="qaction.html#checked-prop">checked</a> property. Connect to it to change the checked state to its opposite state.</p>
<!-- @@@toggle -->
<!-- $$$toggled -->
<h3 class="fn" id="toggled"><a name="toggled"></a><code>[signal] </code><span class="type">void</span> QAction::<span class="name">toggled</span>(<span class="type">bool</span> <i>checked</i>)</h3>
<p>This signal is emitted whenever a checkable action changes its <a href="qaction.html#checked-prop">isChecked</a>() status. This can be the result of a user interaction, or because <a href="qaction.html#checked-prop">setChecked</a>() was called.</p>
<p><i>checked</i> is true if the action is checked, or false if the action is unchecked.</p>
<p><b>Note:</b> Notifier signal for property <a href="qaction.html#checked-prop">checked</a>. </p><p><b>See also </b><a href="qaction.html#activate">QAction::activate</a>(), <a href="qaction.html#triggered">QAction::triggered</a>(), and <a href="qaction.html#checked-prop">checked</a>.</p>
<!-- @@@toggled -->
<!-- $$$trigger[overload1]$$$trigger -->
<h3 class="fn" id="trigger"><a name="trigger"></a><code>[slot] </code><span class="type">void</span> QAction::<span class="name">trigger</span>()</h3>
<p>This is a convenience slot that calls activate(Trigger).</p>
<!-- @@@trigger -->
<!-- $$$triggered[overload1]$$$triggeredbool -->
<h3 class="fn" id="triggered"><a name="triggered"></a><code>[signal] </code><span class="type">void</span> QAction::<span class="name">triggered</span>(<span class="type">bool</span> <i>checked</i> = false)</h3>
<p>This signal is emitted when an action is activated by the user; for example, when the user clicks a menu option, toolbar button, or presses an action's shortcut key combination, or when <a href="qaction.html#trigger">trigger</a>() was called. Notably, it is <i>not</i> emitted when <a href="qaction.html#checked-prop">setChecked</a>() or <a href="qaction.html#toggle">toggle</a>() is called.</p>
<p>If the action is checkable, <i>checked</i> is true if the action is checked, or false if the action is unchecked.</p>
<p><b>See also </b><a href="qaction.html#activate">QAction::activate</a>(), <a href="qaction.html#toggled">QAction::toggled</a>(), and <a href="qaction.html#checked-prop">checked</a>.</p>
<!-- @@@triggered -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    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.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>