Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 3829

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/src/gui/widgets/qcheckbox.cpp -->
<head>
  <title>Qt 4.2: QCheckBox Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QCheckBox Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QCheckBox widget provides a checkbox with a text label. <a href="#details">More...</a></p>
<pre> #include &lt;QCheckBox&gt;</pre><p>Inherits <a href="qabstractbutton.html">QAbstractButton</a>.</p>
<ul>
<li><a href="qcheckbox-members.html">List of all members, including inherited members</a></li>
<li><a href="qcheckbox-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="properties"></a>
<h3>Properties</h3>
<ul>
<li><div class="fn"/><b><a href="qcheckbox.html#tristate-prop">tristate</a></b> : bool</li>
</ul>
<ul>
<li><div class="fn"/>11 properties inherited from <a href="qabstractbutton.html#properties">QAbstractButton</a></li>
<li><div class="fn"/>55 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qcheckbox.html#QCheckBox">QCheckBox</a></b> ( QWidget * <i>parent</i> = 0 )</li>
<li><div class="fn"/><b><a href="qcheckbox.html#QCheckBox-2">QCheckBox</a></b> ( const QString &amp; <i>text</i>, QWidget * <i>parent</i> = 0 )</li>
<li><div class="fn"/>Qt::CheckState <b><a href="qcheckbox.html#checkState">checkState</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qcheckbox.html#tristate-prop">isTristate</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qcheckbox.html#setCheckState">setCheckState</a></b> ( Qt::CheckState <i>state</i> )</li>
<li><div class="fn"/>void <b><a href="qcheckbox.html#tristate-prop">setTristate</a></b> ( bool <i>y</i> = true )</li>
</ul>
<ul>
<li><div class="fn"/>21 public functions inherited from <a href="qabstractbutton.html#public-functions">QAbstractButton</a></li>
<li><div class="fn"/>195 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div class="fn"/>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="signals"></a>
<h3>Signals</h3>
<ul>
<li><div class="fn"/>void <b><a href="qcheckbox.html#stateChanged">stateChanged</a></b> ( int <i>state</i> )</li>
</ul>
<ul>
<li><div class="fn"/>4 signals inherited from <a href="qabstractbutton.html#signals">QAbstractButton</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>5 public slots inherited from <a href="qabstractbutton.html#public-slots">QAbstractButton</a></li>
<li><div class="fn"/>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"/>3 protected functions inherited from <a href="qabstractbutton.html#protected-functions">QAbstractButton</a></li>
<li><div class="fn"/>38 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"/>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"/>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QCheckBox widget provides a checkbox with a text label.</p>
<p>A QCheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others, but different types of behavior can be implemented.</p>
<p>A <a href="qbuttongroup.html">QButtonGroup</a> can be used to group check buttons visually.</p>
<p>Whenever a checkbox is checked or cleared it emits the signal <a href="qcheckbox.html#stateChanged">stateChanged</a>(). Connect to this signal if you want to trigger an action each time the checkbox changes state. You can use <a href="qabstractbutton.html#checked-prop">isChecked</a>() to query whether or not a checkbox is checked.</p>
<p>In addition to the usual checked and unchecked states, QCheckBox optionally provides a third state to indicate &quot;no change&quot;. This is useful whenever you need to give the user the option of neither checking nor unchecking a checkbox. If you need this third state, enable it with <a href="qcheckbox.html#tristate-prop">setTristate</a>(), and use <a href="qcheckbox.html#checkState">checkState</a>() to query the current toggle state.</p>
<p>Just like <a href="qpushbutton.html">QPushButton</a>, a checkbox button displays text, and optionally a small icon. The text can be set in the constructor or with <a href="qabstractbutton.html#text-prop">setText</a>(); the icon is set with <a href="qabstractbutton.html#icon-prop">setIcon</a>().</p>
<p>Important inherited functions: <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-qt3.html#pixmap">pixmap</a>(), <a href="qabstractbutton-qt3.html#setPixmap">setPixmap</a>(), <a href="qabstractbutton-qt3.html#accel">accel</a>(), <a href="qabstractbutton-qt3.html#setAccel">setAccel</a>(), <a href="qabstractbutton-qt3.html#isToggleButton">isToggleButton</a>(), <a href="qabstractbutton.html#down-prop">setDown</a>(), <a href="qabstractbutton.html#down-prop">isDown</a>(), <a href="qabstractbutton-qt3.html#isOn">isOn</a>(), <a href="qcheckbox.html#checkState">checkState</a>(), <a href="qabstractbutton.html#autoRepeat-prop">autoRepeat</a>(), isExclusiveToggle(), <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>(), <a href="qabstractbutton.html#toggled">toggled</a>(), <a href="qcheckbox.html#checkState">checkState</a>(), and <a href="qcheckbox.html#stateChanged">stateChanged</a>().</p>
<p><table width="100%" align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><img src="images/macintosh-checkbox.png" alt="Screenshot of a Macintosh style checkbox" /></td><td>A checkbox shown in the <a href="gallery-macintosh.html">Macintosh widget style</a>.</td></tr>
<tr valign="top" class="even"><td><img src="images/windows-checkbox.png" alt="Screenshot of a Windows XP style checkbox" /></td><td>A checkbox shown in the <a href="gallery-windowsxp.html">Windows XP widget style</a>.</td></tr>
<tr valign="top" class="odd"><td><img src="images/plastique-checkbox.png" alt="Screenshot of a Plastique style checkbox" /></td><td>A checkbox shown in the <a href="gallery-plastique.html">Plastique widget style</a>.</td></tr>
</table></p>
<p>See also <a href="qabstractbutton.html">QAbstractButton</a>, <a href="qradiobutton.html">QRadioButton</a>, and <a href="guibooks.html#fowler">GUI Design Handbook: Check Box</a>.</p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="tristate-prop"></a>tristate : bool</h3>
<p>This property holds whether the checkbox is a tri-state checkbox.</p>
<p>The default is false; i.e. the checkbox has only two states.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool isTristate () const</b></li>
<li><div class="fn"/><b>void setTristate ( bool <i>y</i> = true )</b></li>
</ul>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QCheckBox"></a>QCheckBox::QCheckBox ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a checkbox with the given <i>parent</i>, but with no text.</p>
<p>The <i>parent</i> argument is passed on to the <a href="qabstractbutton.html">QAbstractButton</a> constructor.</p>
<h3 class="fn"><a name="QCheckBox-2"></a>QCheckBox::QCheckBox ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a checkbox with the given <i>parent</i> and <i>text</i>.</p>
<p>The <i>parent</i> argument is passed on to the <a href="qabstractbutton.html">QAbstractButton</a> constructor.</p>
<h3 class="fn"><a name="checkState"></a><a href="qt.html#CheckState-enum">Qt::CheckState</a> QCheckBox::checkState () const</h3>
<p>Returns the check box's check state.</p>
<p>See also <a href="qcheckbox.html#setCheckState">setCheckState</a>() and <a href="qt.html#CheckState-enum">Qt::CheckState</a>.</p>
<h3 class="fn"><a name="setCheckState"></a>void QCheckBox::setCheckState ( <a href="qt.html#CheckState-enum">Qt::CheckState</a> <i>state</i> )</h3>
<p>Sets the check box's check state to <i>state</i>.</p>
<p>See also <a href="qcheckbox.html#checkState">checkState</a>() and <a href="qt.html#CheckState-enum">Qt::CheckState</a>.</p>
<h3 class="fn"><a name="stateChanged"></a>void QCheckBox::stateChanged ( int <i>state</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the check box's state changes, i.e. whenever the user checks or unchecks it.</p>
<p><i>state</i> contains the check box's new <a href="qcheckbox-qt3.html#ToggleState-enum">ToggleState</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="ToggleState-enum"></a>enum QCheckBox::ToggleState</h3>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QCheckBox::Off</tt></td><td align="center" valign="top"><tt>Qt::Unchecked</tt></td><td valign="top">Use <a href="qt.html#CheckState-enum">Qt::Unchecked</a> instead.</td></tr>
<tr><td valign="top"><tt>QCheckBox::NoChange</tt></td><td align="center" valign="top"><tt>Qt::PartiallyChecked</tt></td><td valign="top">Use <a href="qt.html#CheckState-enum">Qt::PartiallyChecked</a> instead.</td></tr>
<tr><td valign="top"><tt>QCheckBox::On</tt></td><td align="center" valign="top"><tt>Qt::Checked</tt></td><td valign="top">Use <a href="qt.html#CheckState-enum">Qt::Checked</a> instead.</td></tr>
</table></p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QCheckBox-3"></a>QCheckBox::QCheckBox ( <a href="qwidget.html">QWidget</a> * <i>parent</i>, const char * <i>name</i> )</h3>
<p>Use one of the constructors that doesn't take the <i>name</i> argument and then use <a href="qobject.html#objectName-prop">setObjectName</a>() instead.</p>
<h3 class="fn"><a name="QCheckBox-4"></a>QCheckBox::QCheckBox ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i>, const char * <i>name</i> )</h3>
<p>Use one of the constructors that doesn't take the <i>name</i> argument and then use <a href="qobject.html#objectName-prop">setObjectName</a>() instead.</p>
<h3 class="fn"><a name="setNoChange"></a>void QCheckBox::setNoChange ()</h3>
<p>Use <a href="qcheckbox.html#setCheckState">setCheckState</a>() instead.</p>
<h3 class="fn"><a name="setState"></a>void QCheckBox::setState ( <a href="qcheckbox-qt3.html#ToggleState-enum">ToggleState</a> <i>state</i> )</h3>
<p>Use <a href="qcheckbox.html#setCheckState">setCheckState</a>() instead.</p>
<p>See also <a href="qcheckbox-qt3.html#state">state</a>().</p>
<h3 class="fn"><a name="state"></a><a href="qcheckbox-qt3.html#ToggleState-enum">ToggleState</a> QCheckBox::state () const</h3>
<p>Use <a href="qcheckbox.html#checkState">checkState</a>() instead.</p>
<p>See also <a href="qcheckbox-qt3.html#setState">setState</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>