Sophie

Sophie

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

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" />
<!-- qtoolbutton.cpp -->
  <title>QToolButton 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 >QToolButton</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="#reimplemented-public-functions">Reimplemented 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="#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">QToolButton Class</h1>
<!-- $$$QToolButton-brief -->
<p>The <a href="qtoolbutton.html">QToolButton</a> class provides a quick-access button to commands or options, usually used inside a <a href="qtoolbar.html">QToolBar</a>. <a href="#details">More...</a></p>
<!-- @@@QToolButton -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QToolButton&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></table></div><ul>
<li><a href="qtoolbutton-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="qtoolbutton.html#ToolButtonPopupMode-enum">ToolButtonPopupMode</a></b> { DelayedPopup, MenuButtonPopup, InstantPopup }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qtoolbutton.html#arrowType-prop">arrowType</a></b> : Qt::ArrowType</li>
<li class="fn"><b><a href="qtoolbutton.html#autoRaise-prop">autoRaise</a></b> : bool</li>
<li class="fn"><b><a href="qtoolbutton.html#popupMode-prop">popupMode</a></b> : ToolButtonPopupMode</li>
<li class="fn"><b><a href="qtoolbutton.html#toolButtonStyle-prop">toolButtonStyle</a></b> : Qt::ToolButtonStyle</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="qtoolbutton.html#QToolButton">QToolButton</a></b>(QWidget *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#dtor.QToolButton">~QToolButton</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::ArrowType </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#arrowType-prop">arrowType</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#autoRaise-prop">autoRaise</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction *</td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#defaultAction">defaultAction</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu *</td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#menu">menu</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ToolButtonPopupMode </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#popupMode-prop">popupMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#arrowType-prop">setArrowType</a></b>(Qt::ArrowType <i>type</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#autoRaise-prop">setAutoRaise</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.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="qtoolbutton.html#popupMode-prop">setPopupMode</a></b>(ToolButtonPopupMode <i>mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::ToolButtonStyle </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#toolButtonStyle-prop">toolButtonStyle</a></b>() const</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="qtoolbutton.html#minimumSizeHint">minimumSizeHint</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.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="qtoolbutton.html#setDefaultAction">setDefaultAction</a></b>(QAction *<i>action</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#toolButtonStyle-prop">setToolButtonStyle</a></b>(Qt::ToolButtonStyle <i>style</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.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="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="qtoolbutton.html#triggered">triggered</a></b>(QAction *<i>action</i>)</td></tr>
</table></div>
<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>
</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="qtoolbutton.html#initStyleOption">initStyleOption</a></b>(QStyleOptionToolButton *<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 void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#actionEvent">actionEvent</a></b>(QActionEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#changeEvent">changeEvent</a></b>(QEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#enterEvent">enterEvent</a></b>(QEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#event">event</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#hitButton">hitButton</a></b>(const QPoint &amp;<i>pos</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#leaveEvent">leaveEvent</a></b>(QEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#mousePressEvent">mousePressEvent</a></b>(QMouseEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#mouseReleaseEvent">mouseReleaseEvent</a></b>(QMouseEvent *<i>e</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#nextCheckState">nextCheckState</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#paintEvent">paintEvent</a></b>(QPaintEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtoolbutton.html#timerEvent">timerEvent</a></b>(QTimerEvent *<i>e</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">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>
<!-- $$$QToolButton-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qtoolbutton.html">QToolButton</a> class provides a quick-access button to commands or options, usually used inside a <a href="qtoolbar.html">QToolBar</a>.</p>
<p>A tool button is a special button that provides quick-access to specific commands or options. As opposed to a normal command button, a tool button usually doesn't show a text label, but shows an icon instead.</p>
<p>Tool buttons are normally created when new <a href="qaction.html">QAction</a> instances are created with <a href="qtoolbar.html#addAction">QToolBar::addAction</a>() or existing actions are added to a toolbar with <a href="qtoolbar.html#addAction">QToolBar::addAction</a>(). It is also possible to construct tool buttons in the same way as any other widget, and arrange them alongside other widgets in layouts.</p>
<p>One classic use of a tool button is to select tools; for example, the &quot;pen&quot; tool in a drawing program. This would be implemented by using a <a href="qtoolbutton.html">QToolButton</a> as a toggle button (see <a href="qabstractbutton.html#checkable-prop">setCheckable</a>()).</p>
<p><a href="qtoolbutton.html">QToolButton</a> supports auto-raising. In auto-raise mode, the button draws a 3D frame only when the mouse points at it. The feature is automatically turned on when a button is used inside a <a href="qtoolbar.html">QToolBar</a>. Change it with <a href="qtoolbutton.html#autoRaise-prop">setAutoRaise</a>().</p>
<p>A tool button's icon is set as <a href="../qtgui/qicon.html">QIcon</a>. This makes it possible to specify different pixmaps for the disabled and active state. The disabled pixmap is used when the button's functionality is not available. The active pixmap is displayed when the button is auto-raised because the mouse pointer is hovering over it.</p>
<p>The button's look and dimension is adjustable with <a href="qtoolbutton.html#toolButtonStyle-prop">setToolButtonStyle</a>() and <a href="qabstractbutton.html#iconSize-prop">setIconSize</a>(). When used inside a <a href="qtoolbar.html">QToolBar</a> in a <a href="qmainwindow.html">QMainWindow</a>, the button automatically adjusts to <a href="qmainwindow.html">QMainWindow</a>'s settings (see <a href="qmainwindow.html#toolButtonStyle-prop">QMainWindow::setToolButtonStyle</a>() and <a href="qmainwindow.html#iconSize-prop">QMainWindow::setIconSize</a>()). Instead of an icon, a tool button can also display an arrow symbol, specified with <a href="qtoolbutton.html#arrowType-prop">arrowType</a>.</p>
<p>A tool button can offer additional choices in a popup menu. The popup menu can be set using <a href="qtoolbutton.html#setMenu">setMenu</a>(). Use <a href="qtoolbutton.html#popupMode-prop">setPopupMode</a>() to configure the different modes available for tool buttons with a menu set. The default mode is DelayedPopupMode which is sometimes used with the &quot;Back&quot; button in a web browser. After pressing and holding the button down for a while, a menu pops up showing a list of possible pages to jump to. The timeout is style dependent, see <a href="qstyle.html#StyleHint-enum">QStyle::SH_ToolButton_PopupDelay</a>.</p>
<div class="table"><table class="generic" width="100%">
 <tr valign="top" class="odd"><td ><img src="images/assistant-toolbar.png" alt="Qt Assistant's toolbar with tool buttons" /></td></tr>
<tr valign="top" class="even"><td >Qt Assistant's toolbar contains tool buttons that are associated with actions used in other parts of the main window.</td></tr>
</table></div>
</div>
<p><b>See also </b><a href="qpushbutton.html">QPushButton</a>, <a href="qtoolbar.html">QToolBar</a>, <a href="qmainwindow.html">QMainWindow</a>, <a href="qaction.html">QAction</a>, and <a href="guibooks.html#fowler">GUI Design Handbook: Push Button</a>.</p>
<!-- @@@QToolButton -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ToolButtonPopupMode$$$DelayedPopup$$$MenuButtonPopup$$$InstantPopup -->
<h3 class="fn" id="ToolButtonPopupMode-enum"><a name="ToolButtonPopupMode-enum"></a>enum QToolButton::<span class="name">ToolButtonPopupMode</span></h3>
<p>Describes how a menu should be popped up for tool buttons that has a menu set or contains a list of actions.</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>QToolButton::DelayedPopup</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">After pressing and holding the tool button down for a certain amount of time (the timeout is style dependent, see <a href="qstyle.html#StyleHint-enum">QStyle::SH_ToolButton_PopupDelay</a>), the menu is displayed. A typical application example is the &quot;back&quot; button in some web browsers's tool bars. If the user clicks it, the browser simply browses back to the previous page. If the user presses and holds the button down for a while, the tool button shows a menu containing the current history list</td></tr>
<tr><td class="topAlign"><code>QToolButton::MenuButtonPopup</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">In this mode the tool button displays a special arrow to indicate that a menu is present. The menu is displayed when the arrow part of the button is pressed.</td></tr>
<tr><td class="topAlign"><code>QToolButton::InstantPopup</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The menu is displayed, without delay, when the tool button is pressed. In this mode, the button's own action is not triggered.</td></tr>
</table></div>
<!-- @@@ToolButtonPopupMode -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$arrowType-prop$$$arrowType$$$setArrowTypeQt::ArrowType -->
<h3 class="fn" id="arrowType-prop"><a name="arrowType-prop"></a><span class="name">arrowType</span> : <span class="type"><a href="../qtcore/qt.html#ArrowType-enum">Qt::ArrowType</a></span></h3>
<p>This property holds whether the button displays an arrow instead of a normal icon</p>
<p>This displays an arrow as the icon for the <a href="qtoolbutton.html">QToolButton</a>.</p>
<p>By default, this property is set to <a href="../qtcore/qt.html#ArrowType-enum">Qt::NoArrow</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::ArrowType </td><td class="memItemRight bottomAlign"><span class="name"><b>arrowType</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setArrowType</b></span>(Qt::ArrowType <i>type</i>)</td></tr>
</table></div>
<!-- @@@arrowType -->
<!-- $$$autoRaise-prop$$$autoRaise$$$setAutoRaisebool -->
<h3 class="fn" id="autoRaise-prop"><a name="autoRaise-prop"></a><span class="name">autoRaise</span> : <span class="type">bool</span></h3>
<p>This property holds whether auto-raising is enabled or not.</p>
<p>The default is disabled (i.e&#x2e; false).</p>
<p>This property is currently ignored on macOS when using QMacStyle.</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>autoRaise</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoRaise</b></span>(bool <i>enable</i>)</td></tr>
</table></div>
<!-- @@@autoRaise -->
<!-- $$$popupMode-prop$$$popupMode$$$setPopupModeToolButtonPopupMode -->
<h3 class="fn" id="popupMode-prop"><a name="popupMode-prop"></a><span class="name">popupMode</span> : <span class="type"><a href="qtoolbutton.html#ToolButtonPopupMode-enum">ToolButtonPopupMode</a></span></h3>
<p>describes the way that popup menus are used with tool buttons</p>
<p>By default, this property is set to <a href="qtoolbutton.html#ToolButtonPopupMode-enum">DelayedPopup</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> ToolButtonPopupMode </td><td class="memItemRight bottomAlign"><span class="name"><b>popupMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPopupMode</b></span>(ToolButtonPopupMode <i>mode</i>)</td></tr>
</table></div>
<!-- @@@popupMode -->
<!-- $$$toolButtonStyle-prop$$$toolButtonStyle$$$setToolButtonStyleQt::ToolButtonStyle -->
<h3 class="fn" id="toolButtonStyle-prop"><a name="toolButtonStyle-prop"></a><span class="name">toolButtonStyle</span> : <span class="type"><a href="../qtcore/qt.html#ToolButtonStyle-enum">Qt::ToolButtonStyle</a></span></h3>
<p>This property holds whether the tool button displays an icon only, text only, or text beside/below the icon.</p>
<p>The default is <a href="../qtcore/qt.html#ToolButtonStyle-enum">Qt::ToolButtonIconOnly</a>.</p>
<p>To have the style of toolbuttons follow the system settings, set this property to <a href="../qtcore/qt.html#ToolButtonStyle-enum">Qt::ToolButtonFollowStyle</a>. On Unix, the user settings from the desktop environment will be used. On other platforms, <a href="../qtcore/qt.html#ToolButtonStyle-enum">Qt::ToolButtonFollowStyle</a> means icon only.</p>
<p><a href="qtoolbutton.html">QToolButton</a> automatically connects this slot to the relevant signal in the <a href="qmainwindow.html">QMainWindow</a> in which is resides.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::ToolButtonStyle </td><td class="memItemRight bottomAlign"><span class="name"><b>toolButtonStyle</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setToolButtonStyle</b></span>(Qt::ToolButtonStyle <i>style</i>)</td></tr>
</table></div>
<!-- @@@toolButtonStyle -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QToolButton[overload1]$$$QToolButtonQWidget* -->
<h3 class="fn" id="QToolButton"><a name="QToolButton"></a>QToolButton::<span class="name">QToolButton</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs an empty tool button with parent <i>parent</i>.</p>
<!-- @@@QToolButton -->
<!-- $$$~QToolButton[overload1]$$$~QToolButton -->
<h3 class="fn" id="dtor.QToolButton"><a name="dtor.QToolButton"></a>QToolButton::<span class="name">~QToolButton</span>()</h3>
<p>Destroys the object and frees any allocated resources.</p>
<!-- @@@~QToolButton -->
<!-- $$$actionEvent[overload1]$$$actionEventQActionEvent* -->
<h3 class="fn" id="actionEvent"><a name="actionEvent"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">actionEvent</span>(<span class="type"><a href="../qtgui/qactionevent.html">QActionEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#actionEvent">QWidget::actionEvent</a>().</p>
<!-- @@@actionEvent -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn" id="changeEvent"><a name="changeEvent"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">changeEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$defaultAction[overload1]$$$defaultAction -->
<h3 class="fn" id="defaultAction"><a name="defaultAction"></a><span class="type"><a href="qaction.html">QAction</a></span> *QToolButton::<span class="name">defaultAction</span>() const</h3>
<p>Returns the default action.</p>
<p><b>See also </b><a href="qtoolbutton.html#setDefaultAction">setDefaultAction</a>().</p>
<!-- @@@defaultAction -->
<!-- $$$enterEvent[overload1]$$$enterEventQEvent* -->
<h3 class="fn" id="enterEvent"><a name="enterEvent"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">enterEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#enterEvent">QWidget::enterEvent</a>().</p>
<!-- @@@enterEvent -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[virtual protected] </code><span class="type">bool</span> QToolButton::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$hitButton[overload1]$$$hitButtonconstQPoint& -->
<h3 class="fn" id="hitButton"><a name="hitButton"></a><code>[virtual protected] </code><span class="type">bool</span> QToolButton::<span class="name">hitButton</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>pos</i>) const</h3>
<p>Reimplemented from <a href="qabstractbutton.html#hitButton">QAbstractButton::hitButton</a>().</p>
<!-- @@@hitButton -->
<!-- $$$initStyleOption[overload1]$$$initStyleOptionQStyleOptionToolButton* -->
<h3 class="fn" id="initStyleOption"><a name="initStyleOption"></a><code>[protected] </code><span class="type">void</span> QToolButton::<span class="name">initStyleOption</span>(<span class="type"><a href="qstyleoptiontoolbutton.html">QStyleOptionToolButton</a></span> *<i>option</i>) const</h3>
<p>Initialize <i>option</i> with the values from this <a href="qtoolbutton.html">QToolButton</a>. This method is useful for subclasses when they need a <a href="qstyleoptiontoolbutton.html">QStyleOptionToolButton</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 -->
<!-- $$$leaveEvent[overload1]$$$leaveEventQEvent* -->
<h3 class="fn" id="leaveEvent"><a name="leaveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">leaveEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#leaveEvent">QWidget::leaveEvent</a>().</p>
<!-- @@@leaveEvent -->
<!-- $$$menu[overload1]$$$menu -->
<h3 class="fn" id="menu"><a name="menu"></a><span class="type"><a href="qmenu.html">QMenu</a></span> *QToolButton::<span class="name">menu</span>() const</h3>
<p>Returns the associated menu, or 0 if no menu has been defined.</p>
<p><b>See also </b><a href="qtoolbutton.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> QToolButton::<span class="name">minimumSizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget::minimumSizeHint</a>().</p>
<!-- @@@minimumSizeHint -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn" id="mousePressEvent"><a name="mousePressEvent"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">mousePressEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQMouseEvent* -->
<h3 class="fn" id="mouseReleaseEvent"><a name="mouseReleaseEvent"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">mouseReleaseEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$nextCheckState[overload1]$$$nextCheckState -->
<h3 class="fn" id="nextCheckState"><a name="nextCheckState"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">nextCheckState</span>()</h3>
<p>Reimplemented from <a href="qabstractbutton.html#nextCheckState">QAbstractButton::nextCheckState</a>().</p>
<!-- @@@nextCheckState -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn" id="paintEvent"><a name="paintEvent"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">paintEvent</span>(<span class="type"><a href="../qtgui/qpaintevent.html">QPaintEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<p>Paints the button in response to the paint <i>event</i>.</p>
<!-- @@@paintEvent -->
<!-- $$$setDefaultAction[overload1]$$$setDefaultActionQAction* -->
<h3 class="fn" id="setDefaultAction"><a name="setDefaultAction"></a><code>[slot] </code><span class="type">void</span> QToolButton::<span class="name">setDefaultAction</span>(<span class="type"><a href="qaction.html">QAction</a></span> *<i>action</i>)</h3>
<p>Sets the default action to <i>action</i>.</p>
<p>If a tool button has a default action, the action defines the button's properties like text, icon, tool tip, etc.</p>
<p><b>See also </b><a href="qtoolbutton.html#defaultAction">defaultAction</a>().</p>
<!-- @@@setDefaultAction -->
<!-- $$$setMenu[overload1]$$$setMenuQMenu* -->
<h3 class="fn" id="setMenu"><a name="setMenu"></a><span class="type">void</span> QToolButton::<span class="name">setMenu</span>(<span class="type"><a href="qmenu.html">QMenu</a></span> *<i>menu</i>)</h3>
<p>Associates the given <i>menu</i> with this tool button.</p>
<p>The menu will be shown according to the button's <a href="qtoolbutton.html#popupMode-prop">popupMode</a>.</p>
<p>Ownership of the menu is not transferred to the tool button.</p>
<p><b>See also </b><a href="qtoolbutton.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> QToolButton::<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> QToolButton::<span class="name">sizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$timerEvent[overload1]$$$timerEventQTimerEvent* -->
<h3 class="fn" id="timerEvent"><a name="timerEvent"></a><code>[virtual protected] </code><span class="type">void</span> QToolButton::<span class="name">timerEvent</span>(<span class="type"><a href="../qtcore/qtimerevent.html">QTimerEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#timerEvent">QObject::timerEvent</a>().</p>
<!-- @@@timerEvent -->
<!-- $$$triggered[overload1]$$$triggeredQAction* -->
<h3 class="fn" id="triggered"><a name="triggered"></a><code>[signal] </code><span class="type">void</span> QToolButton::<span class="name">triggered</span>(<span class="type"><a href="qaction.html">QAction</a></span> *<i>action</i>)</h3>
<p>This signal is emitted when the given <i>action</i> is triggered.</p>
<p>The action may also be associated with other parts of the user interface, such as menu items and keyboard shortcuts. Sharing actions in this way helps make the user interface more consistent and is often less work to implement.</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>