Sophie

Sophie

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

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" />
<!-- qpushbutton.cpp -->
  <title>QPushButton 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 >QPushButton</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="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</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">QPushButton Class</h1>
<!-- $$$QPushButton-brief -->
<p>The <a href="qpushbutton.html">QPushButton</a> widget provides a command button. <a href="#details">More...</a></p>
<!-- @@@QPushButton -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QPushButton&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="qabstractbutton.html">QAbstractButton</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qcommandlinkbutton.html">QCommandLinkButton</a></p>
</td></tr></table></div><ul>
<li><a href="qpushbutton-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qpushbutton.html#autoDefault-prop">autoDefault</a></b> : bool</li>
<li class="fn"><b><a href="qpushbutton.html#default-prop">default</a></b> : bool</li>
<li class="fn"><b><a href="qpushbutton.html#flat-prop">flat</a></b> : bool</li>
</ul>
<ul>
<li class="fn">11 properties inherited from <a href="qabstractbutton.html#properties">QAbstractButton</a></li>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<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="qpushbutton.html#QPushButton">QPushButton</a></b>(QWidget *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#QPushButton-1">QPushButton</a></b>(const QString &amp;<i>text</i>, QWidget *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#QPushButton-2">QPushButton</a></b>(const QIcon &amp;<i>icon</i>, const QString &amp;<i>text</i>, QWidget *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#dtor.QPushButton">~QPushButton</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#autoDefault-prop">autoDefault</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#default-prop">isDefault</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#flat-prop">isFlat</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu *</td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#menu">menu</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#autoDefault-prop">setAutoDefault</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#default-prop">setDefault</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#flat-prop">setFlat</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#setMenu">setMenu</a></b>(QMenu *<i>menu</i>)</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#minimumSizeHint">minimumSizeHint</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#sizeHint">sizeHint</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">21 public functions inherited from <a href="qabstractbutton.html#public-functions">QAbstractButton</a></li>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</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="qpushbutton.html#showMenu">showMenu</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">5 public slots inherited from <a href="qabstractbutton.html#public-slots">QAbstractButton</a></li>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#initStyleOption">initStyleOption</a></b>(QStyleOptionButton *<i>option</i>) const</td></tr>
</table></div>
<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="qpushbutton.html#event">event</a></b>(QEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#focusInEvent">focusInEvent</a></b>(QFocusEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#focusOutEvent">focusOutEvent</a></b>(QFocusEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#keyPressEvent">keyPressEvent</a></b>(QKeyEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpushbutton.html#paintEvent">paintEvent</a></b>(<i>QPaintEvent *</i>)</td></tr>
</table></div>
<ul>
<li class="fn">14 protected functions inherited from <a href="qabstractbutton.html#protected-functions">QAbstractButton</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">4 signals inherited from <a href="qabstractbutton.html#signals">QAbstractButton</a></li>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</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">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
<li class="fn">1 protected type inherited from <a href="../qtgui/qpaintdevice.html#protected-variables">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<!-- $$$QPushButton-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qpushbutton.html">QPushButton</a> widget provides a command button.</p>
<p class="centerAlign"><font color="red">[Missing image windows-pushbutton.jpg]</font></p><p>The push button, or command button, is perhaps the most commonly used widget in any graphical user interface. Push (click) a button to command the computer to perform some action, or to answer a question. Typical buttons are OK, Apply, Cancel, Close, Yes, No and Help.</p>
<p>A command button is rectangular and typically displays a text label describing its action. A shortcut key can be specified by preceding the preferred character with an ampersand in the text. For example:</p>
<pre class="cpp">

  <span class="type"><a href="qpushbutton.html#QPushButton">QPushButton</a></span> <span class="operator">*</span>button <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html#QPushButton">QPushButton</a></span>(<span class="string">&quot;&amp;Download&quot;</span><span class="operator">,</span> <span class="keyword">this</span>);

</pre>
<p>In this example the shortcut is <i>Alt+D</i>. See the <a href="qshortcut.html#mnemonic">QShortcut</a> documentation for details (to display an actual ampersand, use '&amp;&amp;').</p>
<p>Push buttons display a textual label, and optionally a small icon. These can be set using the constructors and changed later using <a href="qabstractbutton.html#text-prop">setText</a>() and <a href="qabstractbutton.html#icon-prop">setIcon</a>(). If the button is disabled, the appearance of the text and icon will be manipulated with respect to the GUI style to make the button look &quot;disabled&quot;.</p>
<p>A push button emits the signal <a href="qabstractbutton.html#clicked">clicked</a>() when it is activated by the mouse, the Spacebar or by a keyboard shortcut. Connect to this signal to perform the button's action. Push buttons also provide less commonly used signals, for example <a href="qabstractbutton.html#pressed">pressed</a>() and <a href="qabstractbutton.html#released">released</a>().</p>
<p>Command buttons in dialogs are by default auto-default buttons, i.e&#x2e;, they become the default push button automatically when they receive the keyboard input focus. A default button is a push button that is activated when the user presses the Enter or Return key in a dialog. You can change this with <a href="qpushbutton.html#autoDefault-prop">setAutoDefault</a>(). Note that auto-default buttons reserve a little extra space which is necessary to draw a default-button indicator. If you do not want this space around your buttons, call <a href="qpushbutton.html#autoDefault-prop">setAutoDefault</a>(false).</p>
<p>Being so central, the button widget has grown to accommodate a great many variations in the past decade. The Microsoft style guide now shows about ten different states of Windows push buttons and the text implies that there are dozens more when all the combinations of features are taken into consideration.</p>
<p>The most important modes or states are:</p>
<ul>
<li>Available or not (grayed out, disabled).</li>
<li>Standard push button, toggling push button or menu button.</li>
<li>On or off (only for toggling push buttons).</li>
<li>Default or normal. The default button in a dialog can generally be &quot;clicked&quot; using the Enter or Return key.</li>
<li>Auto-repeat or not.</li>
<li>Pressed down or not.</li>
</ul>
<p>As a general rule, use a push button when the application or dialog window performs an action when the user clicks on it (such as Apply, Cancel, Close and Help) <i>and</i> when the widget is supposed to have a wide, rectangular shape with a text label. Small, typically square buttons that change the state of the window rather than performing an action (such as the buttons in the top-right corner of the <a href="qfiledialog.html">QFileDialog</a>) are not command buttons, but tool buttons. Qt provides a special class (<a href="qtoolbutton.html">QToolButton</a>) for these buttons.</p>
<p>If you need toggle behavior (see <a href="qabstractbutton.html#checkable-prop">setCheckable</a>()) or a button that auto-repeats the activation signal when being pushed down like the arrows in a scroll bar (see <a href="qabstractbutton.html#autoRepeat-prop">setAutoRepeat</a>()), a command button is probably not what you want. When in doubt, use a tool button.</p>
<p><b>Note: </b>On macOS when a push button's width becomes smaller than 50 or its height becomes smaller than 30, the button's corners are changed from round to square. Use the <a href="qwidget.html#minimumSize-prop">setMinimumSize</a>() function to prevent this behavior.</p><p>A variation of a command button is a menu button. These provide not just one command, but several, since when they are clicked they pop up a menu of options. Use the method <a href="qpushbutton.html#setMenu">setMenu</a>() to associate a popup menu with a push button.</p>
<p>Other classes of buttons are option buttons (see <a href="qradiobutton.html">QRadioButton</a>) and check boxes (see <a href="qcheckbox.html">QCheckBox</a>).</p>
<p>In Qt, the <a href="qabstractbutton.html">QAbstractButton</a> base class provides most of the modes and other API, and <a href="qpushbutton.html">QPushButton</a> provides GUI logic. See <a href="qabstractbutton.html">QAbstractButton</a> for more information about the API.</p>
</div>
<p><b>See also </b><a href="qtoolbutton.html">QToolButton</a>, <a href="qradiobutton.html">QRadioButton</a>, <a href="qcheckbox.html">QCheckBox</a>, and <a href="guibooks.html#fowler">GUI Design Handbook: Push Button</a>.</p>
<!-- @@@QPushButton -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$autoDefault-prop$$$autoDefault$$$setAutoDefaultbool -->
<h3 class="fn" id="autoDefault-prop"><a name="autoDefault-prop"></a><span class="name">autoDefault</span> : <span class="type">bool</span></h3>
<p>This property holds whether the push button is an auto default button</p>
<p>If this property is set to true then the push button is an auto default button.</p>
<p>In some GUI styles a default button is drawn with an extra frame around it, up to 3 pixels or more. Qt automatically keeps this space free around auto-default buttons, i.e&#x2e;, auto-default buttons may have a slightly larger size hint.</p>
<p>This property's default is true for buttons that have a <a href="qdialog.html">QDialog</a> parent; otherwise it defaults to false.</p>
<p>See the <a href="qdialog.html#default">default</a> property for details of how <a href="qdialog.html#default">default</a> and auto-default interact.</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>autoDefault</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoDefault</b></span>(<i>bool</i>)</td></tr>
</table></div>
<!-- @@@autoDefault -->
<!-- $$$default-prop$$$isDefault$$$setDefaultbool -->
<h3 class="fn" id="default-prop"><a name="default-prop"></a><span class="name">default</span> : <span class="type">bool</span></h3>
<p>This property holds whether the push button is the default button</p>
<p>Default and autodefault buttons decide what happens when the user presses enter in a dialog.</p>
<p>A button with this property set to true (i.e&#x2e;, the dialog's <i>default</i> button,) will automatically be pressed when the user presses enter, with one exception: if an <i>autoDefault</i> button currently has focus, the <a href="qpushbutton.html#autoDefault-prop">autoDefault</a> button is pressed. When the dialog has <a href="qpushbutton.html#autoDefault-prop">autoDefault</a> buttons but no default button, pressing enter will press either the <a href="qpushbutton.html#autoDefault-prop">autoDefault</a> button that currently has focus, or if no button has focus, the next <a href="qpushbutton.html#autoDefault-prop">autoDefault</a> button in the focus chain.</p>
<p>In a dialog, only one push button at a time can be the default button. This button is then displayed with an additional frame (depending on the GUI style).</p>
<p>The default button behavior is provided only in dialogs. Buttons can always be clicked from the keyboard by pressing Spacebar when the button has focus.</p>
<p>If the default property is set to false on the current default button while the dialog is visible, a new default will automatically be assigned the next time a push button in the dialog receives focus.</p>
<p>This property's default is false.</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>isDefault</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDefault</b></span>(<i>bool</i>)</td></tr>
</table></div>
<!-- @@@default -->
<!-- $$$flat-prop$$$isFlat$$$setFlatbool -->
<h3 class="fn" id="flat-prop"><a name="flat-prop"></a><span class="name">flat</span> : <span class="type">bool</span></h3>
<p>This property holds whether the button border is raised</p>
<p>This property's default is false. If this property is set, most styles will not paint the button background unless the button is being pressed. <a href="qwidget.html#autoFillBackground-prop">setAutoFillBackground</a>() can be used to ensure that the background is filled using the <a href="../qtgui/qpalette.html#ColorRole-enum">QPalette::Button</a> brush.</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>isFlat</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFlat</b></span>(<i>bool</i>)</td></tr>
</table></div>
<!-- @@@flat -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPushButton[overload1]$$$QPushButtonQWidget* -->
<h3 class="fn" id="QPushButton"><a name="QPushButton"></a>QPushButton::<span class="name">QPushButton</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a push button with no text and a <i>parent</i>.</p>
<!-- @@@QPushButton -->
<!-- $$$QPushButton$$$QPushButtonconstQString&QWidget* -->
<h3 class="fn" id="QPushButton-1"><a name="QPushButton-1"></a>QPushButton::<span class="name">QPushButton</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a push button with the parent <i>parent</i> and the text <i>text</i>.</p>
<!-- @@@QPushButton -->
<!-- $$$QPushButton$$$QPushButtonconstQIcon&constQString&QWidget* -->
<h3 class="fn" id="QPushButton-2"><a name="QPushButton-2"></a>QPushButton::<span class="name">QPushButton</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="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a push button with an <i>icon</i> and a <i>text</i>, and a <i>parent</i>.</p>
<p>Note that you can also pass a <a href="../qtgui/qpixmap.html">QPixmap</a> object as an icon (thanks to the implicit type conversion provided by C++).</p>
<!-- @@@QPushButton -->
<!-- $$$~QPushButton[overload1]$$$~QPushButton -->
<h3 class="fn" id="dtor.QPushButton"><a name="dtor.QPushButton"></a>QPushButton::<span class="name">~QPushButton</span>()</h3>
<p>Destroys the push button.</p>
<!-- @@@~QPushButton -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[virtual protected] </code><span class="type">bool</span> QPushButton::<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 -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn" id="focusInEvent"><a name="focusInEvent"></a><code>[virtual protected] </code><span class="type">void</span> QPushButton::<span class="name">focusInEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget::focusInEvent</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn" id="focusOutEvent"><a name="focusOutEvent"></a><code>[virtual protected] </code><span class="type">void</span> QPushButton::<span class="name">focusOutEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget::focusOutEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$initStyleOption[overload1]$$$initStyleOptionQStyleOptionButton* -->
<h3 class="fn" id="initStyleOption"><a name="initStyleOption"></a><code>[protected] </code><span class="type">void</span> QPushButton::<span class="name">initStyleOption</span>(<span class="type"><a href="qstyleoptionbutton.html">QStyleOptionButton</a></span> *<i>option</i>) const</h3>
<p>Initialize <i>option</i> with the values from this <a href="qpushbutton.html">QPushButton</a>. This method is useful for subclasses when they need a <a href="qstyleoptionbutton.html">QStyleOptionButton</a>, but don't want to fill in all the information themselves.</p>
<p><b>See also </b><a href="qstyleoption.html#initFrom">QStyleOption::initFrom</a>().</p>
<!-- @@@initStyleOption -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn" id="keyPressEvent"><a name="keyPressEvent"></a><code>[virtual protected] </code><span class="type">void</span> QPushButton::<span class="name">keyPressEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<!-- @@@keyPressEvent -->
<!-- $$$menu[overload1]$$$menu -->
<h3 class="fn" id="menu"><a name="menu"></a><span class="type"><a href="qmenu.html">QMenu</a></span> *QPushButton::<span class="name">menu</span>() const</h3>
<p>Returns the button's associated popup menu or 0 if no popup menu has been set.</p>
<p><b>See also </b><a href="qpushbutton.html#setMenu">setMenu</a>().</p>
<!-- @@@menu -->
<!-- $$$minimumSizeHint[overload1]$$$minimumSizeHint -->
<h3 class="fn" id="minimumSizeHint"><a name="minimumSizeHint"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QPushButton::<span class="name">minimumSizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget::minimumSizeHint</a>().</p>
<!-- @@@minimumSizeHint -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn" id="paintEvent"><a name="paintEvent"></a><code>[virtual protected] </code><span class="type">void</span> QPushButton::<span class="name">paintEvent</span>(<i>QPaintEvent *</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<!-- @@@paintEvent -->
<!-- $$$setMenu[overload1]$$$setMenuQMenu* -->
<h3 class="fn" id="setMenu"><a name="setMenu"></a><span class="type">void</span> QPushButton::<span class="name">setMenu</span>(<span class="type"><a href="qmenu.html">QMenu</a></span> *<i>menu</i>)</h3>
<p>Associates the popup menu <i>menu</i> with this push button. This turns the button into a menu button, which in some styles will produce a small triangle to the right of the button's text.</p>
<p>Ownership of the menu is <i>not</i> transferred to the push button.</p>
<p class="centerAlign"><img src="images/fusion-pushbutton-menu.png" alt="Screenshot of a Fusion style push button with popup menu." /></p><p>A push button with popup menus shown in the <a href="gallery.html">Fusion widget style</a>.</p>
<p><b>See also </b><a href="qpushbutton.html#menu">menu</a>().</p>
<!-- @@@setMenu -->
<!-- $$$showMenu[overload1]$$$showMenu -->
<h3 class="fn" id="showMenu"><a name="showMenu"></a><code>[slot] </code><span class="type">void</span> QPushButton::<span class="name">showMenu</span>()</h3>
<p>Shows (pops up) the associated popup menu. If there is no such menu, this function does nothing. This function does not return until the popup menu has been closed by the user.</p>
<!-- @@@showMenu -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QPushButton::<span class="name">sizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<!-- @@@sizeHint -->
</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>