Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 3682

qtbase5-doc-5.12.6-2.mga7.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" />
<!-- qbuttongroup.cpp -->
  <title>QButtonGroup Class | Qt Widgets 5.12.6</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.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QButtonGroup</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></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="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QButtonGroup Class</h1>
<!-- $$$QButtonGroup-brief -->
<p>The <a href="qbuttongroup.html">QButtonGroup</a> class provides a container to organize groups of button widgets. <a href="#details">More...</a></p>
<!-- @@@QButtonGroup -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QButtonGroup&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></table></div><ul>
<li><a href="qbuttongroup-members.html">List of all members, including inherited members</a></li>
<li><a href="qbuttongroup-obsolete.html">Obsolete members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qbuttongroup.html#exclusive-prop">exclusive</a></b> : bool</li>
</ul>
<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="qbuttongroup.html#QButtonGroup">QButtonGroup</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#dtor.QButtonGroup">~QButtonGroup</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#addButton">addButton</a></b>(QAbstractButton *<i>button</i>, int <i>id</i> = -1)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractButton *</td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#button">button</a></b>(int <i>id</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QAbstractButton *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#buttons">buttons</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractButton *</td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#checkedButton">checkedButton</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#checkedId">checkedId</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#exclusive-prop">exclusive</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#id">id</a></b>(QAbstractButton *<i>button</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#removeButton">removeButton</a></b>(QAbstractButton *<i>button</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#exclusive-prop">setExclusive</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#setId">setId</a></b>(QAbstractButton *<i>button</i>, int <i>id</i>)</td></tr>
</table></div>
<ul>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">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="qbuttongroup.html#buttonClicked">buttonClicked</a></b>(QAbstractButton *<i>button</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#buttonClicked-1">buttonClicked</a></b>(int <i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#buttonPressed">buttonPressed</a></b>(QAbstractButton *<i>button</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#buttonPressed-1">buttonPressed</a></b>(int <i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#buttonReleased">buttonReleased</a></b>(QAbstractButton *<i>button</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#buttonReleased-1">buttonReleased</a></b>(int <i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#buttonToggled">buttonToggled</a></b>(QAbstractButton *<i>button</i>, bool <i>checked</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#buttonToggled-1">buttonToggled</a></b>(int <i>id</i>, bool <i>checked</i>)</td></tr>
</table></div>
<ul>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qbuttongroup.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QButtonGroup-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qbuttongroup.html">QButtonGroup</a> class provides a container to organize groups of button widgets.</p>
<p><a href="qbuttongroup.html">QButtonGroup</a> provides an abstract container into which button widgets can be placed. It does not provide a visual representation of this container (see <a href="qgroupbox.html">QGroupBox</a> for a container widget), but instead manages the states of each of the buttons in the group.</p>
<p>An <a href="qbuttongroup.html#exclusive-prop">exclusive</a> button group switches off all checkable (toggle) buttons except the one that has been clicked. By default, a button group is exclusive. The buttons in a button group are usually checkable <a href="qpushbutton.html">QPushButton</a>s, <a href="qcheckbox.html">QCheckBox</a>es (normally for non-exclusive button groups), or <a href="qradiobutton.html">QRadioButton</a>s. If you create an exclusive button group, you should ensure that one of the buttons in the group is initially checked; otherwise, the group will initially be in a state where no buttons are checked.</p>
<p>A button can be added to the group with <a href="qbuttongroup.html#addButton">addButton</a>() and removed with <a href="qbuttongroup.html#removeButton">removeButton</a>(). If the group is exclusive, the currently checked button is available with <a href="qbuttongroup.html#checkedButton">checkedButton</a>(). If a button is clicked, the <a href="qbuttongroup.html#buttonClicked">buttonClicked</a>() signal is emitted; for a checkable button in an exclusive group this means that the button has been checked. The list of buttons in the group is returned by <a href="qbuttongroup.html#buttons">buttons</a>().</p>
<p>In addition, <a href="qbuttongroup.html">QButtonGroup</a> can map between integers and buttons. You can assign an integer id to a button with <a href="qbuttongroup.html#setId">setId</a>(), and retrieve it with <a href="qbuttongroup.html#id">id</a>(). The id of the currently checked button is available with <a href="qbuttongroup.html#checkedId">checkedId</a>(), and there is an overloaded signal <a href="qbuttongroup.html#buttonClicked">buttonClicked</a>() which emits the id of the button. The id <code>-1</code> is reserved by <a href="qbuttongroup.html">QButtonGroup</a> to mean &quot;no such button&quot;. The purpose of the mapping mechanism is to simplify the representation of enum values in a user interface.</p>
</div>
<p><b>See also </b><a href="qgroupbox.html">QGroupBox</a>, <a href="qpushbutton.html">QPushButton</a>, <a href="qcheckbox.html">QCheckBox</a>, and <a href="qradiobutton.html">QRadioButton</a>.</p>
<!-- @@@QButtonGroup -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$exclusive-prop$$$exclusive$$$setExclusivebool -->
<h3 class="fn" id="exclusive-prop"><a name="exclusive-prop"></a><span class="name">exclusive</span> : <span class="type">bool</span></h3>
<p>This property holds whether the button group is exclusive</p>
<p>If this property is <code>true</code>, then only one button in the group can be checked at any given time. The user can click on any button to check it, and that button will replace the existing one as the checked button in the group.</p>
<p>In an exclusive group, the user cannot uncheck the currently checked button by clicking on it; instead, another button in the group must be clicked to set the new checked button for that group.</p>
<p>By default, this property is <code>true</code>.</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>exclusive</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setExclusive</b></span>(<i>bool</i>)</td></tr>
</table></div>
<!-- @@@exclusive -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QButtonGroup[overload1]$$$QButtonGroupQObject* -->
<h3 class="fn" id="QButtonGroup"><a name="QButtonGroup"></a>QButtonGroup::<span class="name">QButtonGroup</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a new, empty button group with the given <i>parent</i>.</p>
<p><b>See also </b><a href="qbuttongroup.html#addButton">addButton</a>() and <a href="qbuttongroup.html#exclusive-prop">setExclusive</a>().</p>
<!-- @@@QButtonGroup -->
<!-- $$$~QButtonGroup[overload1]$$$~QButtonGroup -->
<h3 class="fn" id="dtor.QButtonGroup"><a name="dtor.QButtonGroup"></a><code>[virtual] </code>QButtonGroup::<span class="name">~QButtonGroup</span>()</h3>
<p>Destroys the button group.</p>
<!-- @@@~QButtonGroup -->
<!-- $$$addButton[overload1]$$$addButtonQAbstractButton*int -->
<h3 class="fn" id="addButton"><a name="addButton"></a><span class="type">void</span> QButtonGroup::<span class="name">addButton</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *<i>button</i>, <span class="type">int</span> <i>id</i> = -1)</h3>
<p>Adds the given <i>button</i> to the button group. If <i>id</i> is -1, an id will be assigned to the button. Automatically assigned ids are guaranteed to be negative, starting with -2. If you are assigning your own ids, use positive values to avoid conflicts.</p>
<p><b>See also </b><a href="qbuttongroup.html#removeButton">removeButton</a>() and <a href="qbuttongroup.html#buttons">buttons</a>().</p>
<!-- @@@addButton -->
<!-- $$$button[overload1]$$$buttonint -->
<h3 class="fn" id="button"><a name="button"></a><span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *QButtonGroup::<span class="name">button</span>(<span class="type">int</span> <i>id</i>) const</h3>
<p>Returns the button with the specified <i>id</i>, or 0 if no such button exists.</p>
<p>This function was introduced in  Qt 4.1.</p>
<!-- @@@button -->
<!-- $$$buttonClicked[overload1]$$$buttonClickedQAbstractButton* -->
<h3 class="fn" id="buttonClicked"><a name="buttonClicked"></a><code>[signal] </code><span class="type">void</span> QButtonGroup::<span class="name">buttonClicked</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *<i>button</i>)</h3>
<p>This signal is emitted when the given <i>button</i> is clicked. A button is clicked when it is first pressed and then released, when its shortcut key is typed, or when <a href="qabstractbutton.html#click">QAbstractButton::click</a>() or <a href="qabstractbutton.html#animateClick">QAbstractButton::animateClick</a>() is programmatically called.</p>
<p><b>Note:</b> Signal <i>buttonClicked</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(buttonGroup<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> <span class="operator">*</span><span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbuttongroup.html#QButtonGroup">QButtonGroup</a></span><span class="operator">::</span>buttonClicked)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> <span class="operator">*</span>button){ <span class="comment">/* ... */</span> });

</pre>
<p><b>See also </b><a href="qbuttongroup.html#checkedButton">checkedButton</a>() and <a href="qabstractbutton.html#clicked">QAbstractButton::clicked</a>().</p>
<!-- @@@buttonClicked -->
<!-- $$$buttonClicked$$$buttonClickedint -->
<h3 class="fn" id="buttonClicked-1"><a name="buttonClicked-1"></a><code>[signal] </code><span class="type">void</span> QButtonGroup::<span class="name">buttonClicked</span>(<span class="type">int</span> <i>id</i>)</h3>
<p>This signal is emitted when a button with the given <i>id</i> is clicked.</p>
<p><b>Note:</b> Signal <i>buttonClicked</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(buttonGroup<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbuttongroup.html#QButtonGroup">QButtonGroup</a></span><span class="operator">::</span>buttonClicked)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type">int</span> id){ <span class="comment">/* ... */</span> });

</pre>
<p><b>See also </b><a href="qbuttongroup.html#checkedButton">checkedButton</a>() and <a href="qabstractbutton.html#clicked">QAbstractButton::clicked</a>().</p>
<!-- @@@buttonClicked -->
<!-- $$$buttonPressed[overload1]$$$buttonPressedQAbstractButton* -->
<h3 class="fn" id="buttonPressed"><a name="buttonPressed"></a><code>[signal] </code><span class="type">void</span> QButtonGroup::<span class="name">buttonPressed</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *<i>button</i>)</h3>
<p>This signal is emitted when the given <i>button</i> is pressed down.</p>
<p><b>Note:</b> Signal <i>buttonPressed</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(buttonGroup<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> <span class="operator">*</span><span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbuttongroup.html#QButtonGroup">QButtonGroup</a></span><span class="operator">::</span>buttonPressed)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> <span class="operator">*</span>button){ <span class="comment">/* ... */</span> });

</pre>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qabstractbutton.html#pressed">QAbstractButton::pressed</a>().</p>
<!-- @@@buttonPressed -->
<!-- $$$buttonPressed$$$buttonPressedint -->
<h3 class="fn" id="buttonPressed-1"><a name="buttonPressed-1"></a><code>[signal] </code><span class="type">void</span> QButtonGroup::<span class="name">buttonPressed</span>(<span class="type">int</span> <i>id</i>)</h3>
<p>This signal is emitted when a button with the given <i>id</i> is pressed down.</p>
<p><b>Note:</b> Signal <i>buttonPressed</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(buttonGroup<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbuttongroup.html#QButtonGroup">QButtonGroup</a></span><span class="operator">::</span>buttonPressed)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type">int</span> id){ <span class="comment">/* ... */</span> });

</pre>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qabstractbutton.html#pressed">QAbstractButton::pressed</a>().</p>
<!-- @@@buttonPressed -->
<!-- $$$buttonReleased[overload1]$$$buttonReleasedQAbstractButton* -->
<h3 class="fn" id="buttonReleased"><a name="buttonReleased"></a><code>[signal] </code><span class="type">void</span> QButtonGroup::<span class="name">buttonReleased</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *<i>button</i>)</h3>
<p>This signal is emitted when the given <i>button</i> is released.</p>
<p><b>Note:</b> Signal <i>buttonReleased</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(buttonGroup<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> <span class="operator">*</span><span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbuttongroup.html#QButtonGroup">QButtonGroup</a></span><span class="operator">::</span>buttonReleased)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> <span class="operator">*</span>button){ <span class="comment">/* ... */</span> });

</pre>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qabstractbutton.html#released">QAbstractButton::released</a>().</p>
<!-- @@@buttonReleased -->
<!-- $$$buttonReleased$$$buttonReleasedint -->
<h3 class="fn" id="buttonReleased-1"><a name="buttonReleased-1"></a><code>[signal] </code><span class="type">void</span> QButtonGroup::<span class="name">buttonReleased</span>(<span class="type">int</span> <i>id</i>)</h3>
<p>This signal is emitted when a button with the given <i>id</i> is released.</p>
<p><b>Note:</b> Signal <i>buttonReleased</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(buttonGroup<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbuttongroup.html#QButtonGroup">QButtonGroup</a></span><span class="operator">::</span>buttonReleased)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type">int</span> id){ <span class="comment">/* ... */</span> });

</pre>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qabstractbutton.html#released">QAbstractButton::released</a>().</p>
<!-- @@@buttonReleased -->
<!-- $$$buttonToggled[overload1]$$$buttonToggledQAbstractButton*bool -->
<h3 class="fn" id="buttonToggled"><a name="buttonToggled"></a><code>[signal] </code><span class="type">void</span> QButtonGroup::<span class="name">buttonToggled</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *<i>button</i>, <span class="type">bool</span> <i>checked</i>)</h3>
<p>This signal is emitted when the given <i>button</i> is toggled. <i>checked</i> is true if the button is checked, or false if the button is unchecked.</p>
<p><b>Note:</b> Signal <i>buttonToggled</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(buttonGroup<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> <span class="operator">*</span><span class="operator">,</span> bool<span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbuttongroup.html#QButtonGroup">QButtonGroup</a></span><span class="operator">::</span>buttonToggled)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> <span class="operator">*</span>button<span class="operator">,</span> bool checked){ <span class="comment">/* ... */</span> });

</pre>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qabstractbutton.html#toggled">QAbstractButton::toggled</a>().</p>
<!-- @@@buttonToggled -->
<!-- $$$buttonToggled$$$buttonToggledintbool -->
<h3 class="fn" id="buttonToggled-1"><a name="buttonToggled-1"></a><code>[signal] </code><span class="type">void</span> QButtonGroup::<span class="name">buttonToggled</span>(<span class="type">int</span> <i>id</i>, <span class="type">bool</span> <i>checked</i>)</h3>
<p>This signal is emitted when a button with the given <i>id</i> is toggled. <i>checked</i> is true if the button is checked, or false if the button is unchecked.</p>
<p><b>Note:</b> Signal <i>buttonToggled</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(buttonGroup<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">,</span> bool<span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qbuttongroup.html#QButtonGroup">QButtonGroup</a></span><span class="operator">::</span>buttonToggled)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type">int</span> id<span class="operator">,</span> bool checked){ <span class="comment">/* ... */</span> });

</pre>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qabstractbutton.html#toggled">QAbstractButton::toggled</a>().</p>
<!-- @@@buttonToggled -->
<!-- $$$buttons[overload1]$$$buttons -->
<h3 class="fn" id="buttons"><a name="buttons"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *&gt; QButtonGroup::<span class="name">buttons</span>() const</h3>
<p>Returns the button group's list of buttons. This may be empty.</p>
<p><b>See also </b><a href="qbuttongroup.html#addButton">addButton</a>() and <a href="qbuttongroup.html#removeButton">removeButton</a>().</p>
<!-- @@@buttons -->
<!-- $$$checkedButton[overload1]$$$checkedButton -->
<h3 class="fn" id="checkedButton"><a name="checkedButton"></a><span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *QButtonGroup::<span class="name">checkedButton</span>() const</h3>
<p>Returns the button group's checked button, or 0 if no buttons are checked.</p>
<p><b>See also </b><a href="qbuttongroup.html#buttonClicked">buttonClicked</a>().</p>
<!-- @@@checkedButton -->
<!-- $$$checkedId[overload1]$$$checkedId -->
<h3 class="fn" id="checkedId"><a name="checkedId"></a><span class="type">int</span> QButtonGroup::<span class="name">checkedId</span>() const</h3>
<p>Returns the id of the <a href="qbuttongroup.html#checkedButton">checkedButton</a>(), or -1 if no button is checked.</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qbuttongroup.html#setId">setId</a>().</p>
<!-- @@@checkedId -->
<!-- $$$id[overload1]$$$idQAbstractButton* -->
<h3 class="fn" id="id"><a name="id"></a><span class="type">int</span> QButtonGroup::<span class="name">id</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *<i>button</i>) const</h3>
<p>Returns the id for the specified <i>button</i>, or -1 if no such button exists.</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qbuttongroup.html#setId">setId</a>().</p>
<!-- @@@id -->
<!-- $$$removeButton[overload1]$$$removeButtonQAbstractButton* -->
<h3 class="fn" id="removeButton"><a name="removeButton"></a><span class="type">void</span> QButtonGroup::<span class="name">removeButton</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *<i>button</i>)</h3>
<p>Removes the given <i>button</i> from the button group.</p>
<p><b>See also </b><a href="qbuttongroup.html#addButton">addButton</a>() and <a href="qbuttongroup.html#buttons">buttons</a>().</p>
<!-- @@@removeButton -->
<!-- $$$setId[overload1]$$$setIdQAbstractButton*int -->
<h3 class="fn" id="setId"><a name="setId"></a><span class="type">void</span> QButtonGroup::<span class="name">setId</span>(<span class="type"><a href="qabstractbutton.html">QAbstractButton</a></span> *<i>button</i>, <span class="type">int</span> <i>id</i>)</h3>
<p>Sets the <i>id</i> for the specified <i>button</i>. Note that <i>id</i> cannot be -1.</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qbuttongroup.html#id">id</a>().</p>
<!-- @@@setId -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>