Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 28b9e36e96ce34b2567ae5b47a27b2c5 > files > 544

python-qt4-doc-4.10.3-3.mga4.noarch.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QCheckBox Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></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>

<p>Inherits <a href="qabstractbutton.html">QAbstractButton</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qcheckbox.html#QCheckBox">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qcheckbox.html#QCheckBox-2">__init__</a></b> (<i>self</i>, QString&#160;<i>text</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />Qt.CheckState <b><a href="qcheckbox.html#checkState">checkState</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcheckbox.html#checkStateSet">checkStateSet</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qcheckbox.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>e</i>)</li><li><div class="fn" />bool <b><a href="qcheckbox.html#hitButton">hitButton</a></b> (<i>self</i>, QPoint&#160;<i>pos</i>)</li><li><div class="fn" /><b><a href="qcheckbox.html#initStyleOption">initStyleOption</a></b> (<i>self</i>, QStyleOptionButton&#160;<i>option</i>)</li><li><div class="fn" />bool <b><a href="qcheckbox.html#isTristate">isTristate</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qcheckbox.html#minimumSizeHint">minimumSizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcheckbox.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qcheckbox.html#nextCheckState">nextCheckState</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qcheckbox.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent)</li><li><div class="fn" /><b><a href="qcheckbox.html#setCheckState">setCheckState</a></b> (<i>self</i>, Qt.CheckState&#160;<i>state</i>)</li><li><div class="fn" /><b><a href="qcheckbox.html#setTristate">setTristate</a></b> (<i>self</i>, bool&#160;<i>on</i>&#160;=&#160;True)</li><li><div class="fn" />QSize <b><a href="qcheckbox.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qcheckbox.html#stateChanged">stateChanged</a></b> (int)</li></ul><a name="details" /><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. For example, a <a href="qbuttongroup.html">QButtonGroup</a> can be used to group check
buttons logically, allowing exclusive checkboxes. However, <a href="qbuttongroup.html">QButtonGroup</a> does not provide any visual
representation.</p>
<p>The image below further illustrates the differences between
exclusive and non-exclusive checkboxes.</p>
<table class="generic">
<tr class="odd" valign="top">
<td><img alt="" src="images/checkboxes-exclusive.png" /></td>
<td><img alt="" src="images/checkboxes-non-exclusive.png" /></td>
</tr>
</table>
<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 "no change". 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
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. For example:</p>
<pre class="cpp">
 <span class="type">QCheckBox</span> <span class="operator">*</span>checkbox <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QCheckBox</span>(<span class="string">"C&amp;ase sensitive"</span><span class="operator">,</span> <span class="keyword">this</span>);
</pre>
<p>In this example the shortcut is <i>Alt+A</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 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 class="compat" href="qabstractbutton-qt3.html#pixmap">pixmap</a>(),
<a class="compat" href="qabstractbutton-qt3.html#setPixmap">setPixmap</a>(), <a class="compat" href="qabstractbutton-qt3.html#accel">accel</a>(), <a class="compat" href="qabstractbutton-qt3.html#setAccel">setAccel</a>(),
<a class="compat" href="qabstractbutton-qt3.html#isToggleButton">isToggleButton</a>(), <a href="qabstractbutton.html#down-prop">setDown</a>(), <a href="qabstractbutton.html#down-prop">isDown</a>(), <a class="compat" 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>
<table class="generic" width="100%">
<tr class="odd" valign="top">
<td><img alt="Screenshot of a Macintosh style checkbox" src="images/macintosh-checkbox.png" /></td>
<td>A checkbox shown in the <a href="gallery-macintosh.html">Macintosh widget style</a>.</td>
</tr>
<tr class="even" valign="top">
<td><img alt="Screenshot of a Windows XP style checkbox" src="images/windows-checkbox.png" /></td>
<td>A checkbox shown in the <a href="gallery-windowsxp.html">Windows XP widget style</a>.</td>
</tr>
<tr class="odd" valign="top">
<td><img alt="Screenshot of a Plastique style checkbox" src="images/plastique-checkbox.png" /></td>
<td>A checkbox shown in the <a href="gallery-plastique.html">Plastique widget style</a>.</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QCheckBox" />QCheckBox.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a checkbox with the given <i>parent</i>, but with no
text.</p>
<p><i>parent</i> is passed on to the <a href="qabstractbutton.html">QAbstractButton</a> constructor.</p>


<h3 class="fn"><a name="QCheckBox-2" />QCheckBox.__init__ (<i>self</i>, QString&#160;<i>text</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a checkbox with the given <i>parent</i> and
<i>text</i>.</p>
<p><i>parent</i> is passed on to the <a href="qabstractbutton.html">QAbstractButton</a> constructor.</p>


<h3 class="fn"><a name="checkState" /><a href="qt.html#CheckState-enum">Qt.CheckState</a> QCheckBox.checkState (<i>self</i>)</h3><p>Returns the check box's check state. If you do not need tristate
support, you can also use <a href="qabstractbutton.html#checked-prop">QAbstractButton.isChecked</a>()
which returns a boolean.</p>
<p><b>See also</b> <a href="qcheckbox.html#setCheckState">setCheckState</a>() and <a href="qt.html#CheckState-enum">Qt.CheckState</a>.</p>


<h3 class="fn"><a name="checkStateSet" />QCheckBox.checkStateSet (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractbutton.html#checkStateSet">QAbstractButton.checkStateSet</a>().</p>


<h3 class="fn"><a name="event" />bool QCheckBox.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>


<h3 class="fn"><a name="hitButton" />bool QCheckBox.hitButton (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>pos</i>)</h3><p>Reimplemented from <a href="qabstractbutton.html#hitButton">QAbstractButton.hitButton</a>().</p>


<h3 class="fn"><a name="initStyleOption" />QCheckBox.initStyleOption (<i>self</i>, <a href="qstyleoptionbutton.html">QStyleOptionButton</a>&#160;<i>option</i>)</h3><p>Initializes <i>option</i> with the values from this <a href="qcheckbox.html">QCheckBox</a>. This method is useful for
subclasses that require a <a href="qstyleoptionbutton.html">QStyleOptionButton</a>, but do not want
to fill in all the information themselves.</p>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">QStyleOption.initFrom</a>().</p>


<h3 class="fn"><a name="isTristate" />bool QCheckBox.isTristate (<i>self</i>)</h3><h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QCheckBox.minimumSizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget.minimumSizeHint</a>().</p>
<p>This function was introduced in Qt 4.8.</p>


<h3 class="fn"><a name="mouseMoveEvent" />QCheckBox.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget.mouseMoveEvent</a>().</p>


<h3 class="fn"><a name="nextCheckState" />QCheckBox.nextCheckState (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractbutton.html#nextCheckState">QAbstractButton.nextCheckState</a>().</p>


<h3 class="fn"><a name="paintEvent" />QCheckBox.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>


<h3 class="fn"><a name="setCheckState" />QCheckBox.setCheckState (<i>self</i>, <a href="qt.html#CheckState-enum">Qt.CheckState</a>&#160;<i>state</i>)</h3><p>Sets the check box's check state to <i>state</i>. If you do not
need tristate support, you can also use <a href="qabstractbutton.html#checked-prop">QAbstractButton.setChecked</a>()
which takes a boolean.</p>
<p><b>See also</b> <a href="qcheckbox.html#checkState">checkState</a>() and <a href="qt.html#CheckState-enum">Qt.CheckState</a>.</p>


<h3 class="fn"><a name="setTristate" />QCheckBox.setTristate (<i>self</i>, bool&#160;<i>on</i>&#160;=&#160;True)</h3><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QCheckBox.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>


<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="stateChanged" />void stateChanged (int)</h3><p>This is the default overload of this signal.</p><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="qt.html#CheckState-enum">Qt.CheckState</a>.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.10.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.5</td></tr></table></div></address></body></html>