File: qcheckbox.html

package info (click to toggle)
python-qt4 4.0.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,632 kB
  • ctags: 2,639
  • sloc: python: 29,409; sh: 5,646; cpp: 3,168; xml: 149; makefile: 109
file content (44 lines) | stat: -rw-r--r-- 10,229 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?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="../pyqt4ref.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" />bool <b><a href="qcheckbox.html#isTristate">isTristate</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>y</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.</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 "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 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>
<table align="center" border="0" cellpadding="2" cellspacing="1" width="100%">
<tr bgcolor="#F0F0F0" 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 bgcolor="#E0E0E0" 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 bgcolor="#F0F0F0" 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>
<br />
<br />
<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>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>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" />QCheckBox.__init__ (<i>self</i>, <a href="qstring.html">QString</a>&#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>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 href="qt.html#CheckState-enum">Qt.CheckState</a> QCheckBox.checkState (<i>self</i>)</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="checkStateSet" />QCheckBox.checkStateSet (<i>self</i>)</h3><h3 class="fn"><a name="event" />bool QCheckBox.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><h3 class="fn"><a name="hitButton" />bool QCheckBox.hitButton (<i>self</i>, <a href="qpoint.html">QPoint</a>&#160;<i>pos</i>)</h3><h3 class="fn"><a name="isTristate" />bool QCheckBox.isTristate (<i>self</i>)</h3><h3 class="fn"><a name="mouseMoveEvent" />QCheckBox.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><h3 class="fn"><a name="nextCheckState" />QCheckBox.nextCheckState (<i>self</i>)</h3><h3 class="fn"><a name="paintEvent" />QCheckBox.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><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>.</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="setTristate" />QCheckBox.setTristate (<i>self</i>, bool&#160;<i>y</i>&#160;=&#160;True)</h3><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QCheckBox.sizeHint (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="stateChanged" />void stateChanged (int)</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>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt&#160;4.0.1 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.trolltech.com">Trolltech&#160;AS</a> 2006</td><td align="right" width="25%">Qt&#160;4.1.4</td></tr></table></div></address></body></html>