Sophie

Sophie

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

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" />
<!-- qradiobutton.cpp -->
  <title>QRadioButton 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 >QRadioButton</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="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</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">QRadioButton Class</h1>
<!-- $$$QRadioButton-brief -->
<p>The <a href="qradiobutton.html">QRadioButton</a> widget provides a radio button with a text label. <a href="#details">More...</a></p>
<!-- @@@QRadioButton -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QRadioButton&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="qradiobutton-members.html">List of all members, including inherited members</a></li>
<li><a href="qradiobutton-obsolete.html">Obsolete members</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="qradiobutton.html#QRadioButton">QRadioButton</a></b>(QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qradiobutton.html#QRadioButton-1">QRadioButton</a></b>(const QString &amp;<i>text</i>, QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qradiobutton.html#dtor.QRadioButton">~QRadioButton</a></b>()</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="qradiobutton.html#minimumSizeHint">minimumSizeHint</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qradiobutton.html#sizeHint">sizeHint</a></b>() const override</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">31 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="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="qradiobutton.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">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="qradiobutton.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="qradiobutton.html#event">event</a></b>(QEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qradiobutton.html#hitButton">hitButton</a></b>(const QPoint &amp;<i>pos</i>) const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qradiobutton.html#mouseMoveEvent">mouseMoveEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qradiobutton.html#paintEvent">paintEvent</a></b>(<i>QPaintEvent *</i>) override</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">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>
<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>
<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 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QRadioButton-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qradiobutton.html">QRadioButton</a> widget provides a radio button with a text label.</p>
<p class="centerAlign"><img src="images/windows-radiobutton.png" alt="" /></p><p>A <a href="qradiobutton.html">QRadioButton</a> is an option button that can be switched on (checked) or off (unchecked). Radio buttons typically present the user with a &quot;one of many&quot; choice. In a group of radio buttons, only one radio button at a time can be checked; if the user selects another button, the previously selected button is switched off.</p>
<p>Radio buttons are <a href="qabstractbutton.html#autoExclusive-prop">autoExclusive</a> by default. If auto-exclusive is enabled, radio buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. If you need multiple exclusive button groups for radio buttons that belong to the same parent widget, put them into a <a href="qbuttongroup.html">QButtonGroup</a>.</p>
<p>Whenever a button is switched on or off, it emits the <a href="qabstractbutton.html#toggled">toggled</a>() signal. Connect to this signal if you want to trigger an action each time the button changes state. Use <a href="qabstractbutton.html#checked-prop">isChecked</a>() to see if a particular button is selected.</p>
<p>Just like <a href="qpushbutton.html">QPushButton</a>, a radio button displays text, and optionally a small icon. The icon is set with <a href="qabstractbutton.html#icon-prop">setIcon</a>(). The text can be set in the constructor or with <a href="qabstractbutton.html#text-prop">setText</a>(). 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="qradiobutton.html#QRadioButton">QRadioButton</a></span> <span class="operator">*</span>button <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qradiobutton.html#QRadioButton">QRadioButton</a></span>(<span class="string">&quot;Search from the &amp;cursor&quot;</span><span class="operator">,</span> <span class="keyword">this</span>);

</pre>
<p>In this example the shortcut is <i>Alt+c</i>. See the <a href="qshortcut.html#mnemonic">QShortcut</a> documentation for details. To display an actual ampersand, use '&amp;&amp;'.</p>
<p>Important inherited members: <a href="qabstractbutton.html#text-prop">text</a>(), <a href="qabstractbutton.html#text-prop">setText</a>(), <a href="qabstractbutton.html#text-prop">text</a>(), <a href="qabstractbutton.html#down-prop">setDown</a>(), <a href="qabstractbutton.html#down-prop">isDown</a>(), <a href="qabstractbutton.html#autoRepeat-prop">autoRepeat</a>(), <a href="qabstractbutton.html#group">group</a>(), <a href="qabstractbutton.html#autoRepeat-prop">setAutoRepeat</a>(), <a href="qabstractbutton.html#toggle">toggle</a>(), <a href="qabstractbutton.html#pressed">pressed</a>(), <a href="qabstractbutton.html#released">released</a>(), <a href="qabstractbutton.html#clicked">clicked</a>(), and <a href="qabstractbutton.html#toggled">toggled</a>().</p>
</div>
<p><b>See also </b><a href="qpushbutton.html">QPushButton</a>, <a href="qtoolbutton.html">QToolButton</a>, <a href="qcheckbox.html">QCheckBox</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Radio Button</a>, and <a href="qtwidgets-widgets-groupbox-example.html">Group Box Example</a>.</p>
<!-- @@@QRadioButton -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QRadioButton[overload1]$$$QRadioButtonQWidget* -->
<h3 class="fn" id="QRadioButton"><a name="QRadioButton"></a>QRadioButton::<span class="name">QRadioButton</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a radio button with the given <i>parent</i>, but with no text or pixmap.</p>
<p>The <i>parent</i> argument is passed on to the <a href="qabstractbutton.html">QAbstractButton</a> constructor.</p>
<!-- @@@QRadioButton -->
<!-- $$$QRadioButton$$$QRadioButtonconstQString&QWidget* -->
<h3 class="fn" id="QRadioButton-1"><a name="QRadioButton-1"></a>QRadioButton::<span class="name">QRadioButton</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> = nullptr)</h3>
<p>Constructs a radio button with the given <i>parent</i> and <i>text</i> string.</p>
<p>The <i>parent</i> argument is passed on to the <a href="qabstractbutton.html">QAbstractButton</a> constructor.</p>
<!-- @@@QRadioButton -->
<!-- $$$~QRadioButton[overload1]$$$~QRadioButton -->
<h3 class="fn" id="dtor.QRadioButton"><a name="dtor.QRadioButton"></a><code>[virtual] </code>QRadioButton::<span class="name">~QRadioButton</span>()</h3>
<p>Destructor.</p>
<!-- @@@~QRadioButton -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[override virtual protected] </code><span class="type">bool</span> QRadioButton::<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="qabstractbutton.html#event">QAbstractButton::event</a>().</p>
<!-- @@@event -->
<!-- $$$hitButton[overload1]$$$hitButtonconstQPoint& -->
<h3 class="fn" id="hitButton"><a name="hitButton"></a><code>[override virtual protected] </code><span class="type">bool</span> QRadioButton::<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]$$$initStyleOptionQStyleOptionButton* -->
<h3 class="fn" id="initStyleOption"><a name="initStyleOption"></a><code>[protected] </code><span class="type">void</span> QRadioButton::<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="qradiobutton.html">QRadioButton</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 -->
<!-- $$$minimumSizeHint[overload1]$$$minimumSizeHint -->
<h3 class="fn" id="minimumSizeHint"><a name="minimumSizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QRadioButton::<span class="name">minimumSizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget::minimumSizeHint</a>().</p>
<!-- @@@minimumSizeHint -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQMouseEvent* -->
<h3 class="fn" id="mouseMoveEvent"><a name="mouseMoveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QRadioButton::<span class="name">mouseMoveEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qabstractbutton.html#mouseMoveEvent">QAbstractButton::mouseMoveEvent</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn" id="paintEvent"><a name="paintEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QRadioButton::<span class="name">paintEvent</span>(<i>QPaintEvent *</i>)</h3>
<p>Reimplemented from <a href="qabstractbutton.html#paintEvent">QAbstractButton::paintEvent</a>().</p>
<!-- @@@paintEvent -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QRadioButton::<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> 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>