File: qradiobutton.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (151 lines) | stat: -rw-r--r-- 10,143 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QRadioButton Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>QRadioButton Class Reference</h1><br clear="all">
<p>
The QRadioButton widget provides a radio button with a text label.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qradiobutton-h.html">qradiobutton.h</a>&gt;</code>
<p>
Inherits <a href="qbutton.html">QButton</a>.
<p><a href="qradiobutton-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#e2f23a"><b>QRadioButton</b></a>(QWidget*parent, constchar*name=0)</div>
<li><div class="fn"><a href="#e35d9c"><b>QRadioButton</b></a>(constQString&amp;text, QWidget*parent, constchar*name=0)</div>
<li><div class="fn">bool<a href="#da7700"><b>isChecked</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#0e50fc"><b>setChecked</b></a>(boolcheck)</div>
</ul>
<h2>Important Inherited Members</h2>
<ul>
<li><div class="fn">QString<a href="qbutton.html#6033fb"><b>text</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="qbutton.html#989f4f"><b>setText</b></a>(constQString&amp;text)</div>
<li><div class="fn">QString<a href="qbutton.html#6033fb"><b>text</b></a>()const</div>
<li><div class="fn">constQPixmap*<a href="qbutton.html#0e318f"><b>pixmap</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="qbutton.html#27e4fe"><b>setPixmap</b></a>(constQPixmap&amp;pixmap)</div>
<li><div class="fn">int<a href="qbutton.html#eff9e3"><b>accel</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="qbutton.html#da0271"><b>setAccel</b></a>(intkey)</div>
<li><div class="fn">bool<a href="qbutton.html#1ad908"><b>isToggleButton</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="qbutton.html#f865ac"><b>setDown</b></a>(boolenable)</div>
<li><div class="fn">bool<a href="qbutton.html#ea8b93"><b>isDown</b></a>()const</div>
<li><div class="fn">bool<a href="qbutton.html#12ce08"><b>isOn</b></a>()const</div>
<li><div class="fn">bool<a href="qbutton.html#359c59"><b>autoRepeat</b></a>()const</div>
<li><div class="fn">bool<a href="qbutton.html#7ab492"><b>isExclusiveToggle</b></a>()const</div>
<li><div class="fn">QButtonGroup*<a href="qbutton.html#a64d2c"><b>group</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="qbutton.html#221ffa"><b>setAutoRepeat</b></a>(boolenable)</div>
<li><div class="fn">void<a href="qbutton.html#e6faa9"><b>toggle</b></a>()</div>
<li><div class="fn">void<a href="qbutton.html#a27000"><b>pressed</b></a>()</div>
<li><div class="fn">void<a href="qbutton.html#e6fa8e"><b>released</b></a>()</div>
<li><div class="fn">void<a href="qbutton.html#da7248"><b>clicked</b></a>()</div>
<li><div class="fn">void<a href="qbutton.html#4069b1"><b>toggled</b></a>(boolon)</div>
<li><div class="fn">void<a href="qbutton.html#3369ee"><b>stateChanged</b></a>(intstate)</div>
</ul>
<h2>Properties</h2>
<table border=1 cellpadding=3 cellspacing=0>
<tr><th>Type<th>Name<th>READ<th>WRITE<th>Options
<tr><td>bool<td>checked<td>isChecked<td>setChecked<td>&nbsp;
</table>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QRadioButton widget provides a radio button with a text label.
<p>
QRadioButton and <a href="qcheckbox.html">QCheckBox</a> are both option buttons. That is, they
can be switched on (checked) or off (unchecked). The classes differ
in how the choices for the user are restricted. Check-boxes define
"many of many" choices, while radio buttons provide a "one of many"
choice. In a group of radio buttons, only one button at a time can
be checked. If the user selects another button, the previously
selected button is switched off.
<p>While it is technically possible to implement radio-behaviour with
check boxes and vice versa, it's strongly recommended to stick with
the well-known semantics. Otherwise your users would be pretty
confused.
<p>The easiest way to implement a "one of many" choice, is to simply
stick the radio buttons into <a href="qbuttongroup.html">QButtonGroup</a>.
<p>Whenver a button is switched on or off, it emits the signal
<a href="qbutton.html#4069b1">toggled</a>(). Connect to this signal if you want to trigger an action
each time the button changes state. Otherwise, use <a href="#da7700">isChecked</a>() to
query whether or not a particular button is selected.
<p><img src=qradiobt-m.png> <img src=qradiobt-w.png>
<p>See also  <a href="qpushbutton.html">QPushButton</a>, <a href="qtoolbutton.html">QToolButton</a> and <a href="guibooks.html#fowler">GUI Design Handbook: Radio Button</a>
<p>Examples:
 <a href="xform-xform-cpp.html#QRadioButton">xform/xform.cpp</a>
 <a href="drawdemo-drawdemo-cpp.html#QRadioButton">drawdemo/drawdemo.cpp</a>

<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="e2f23a"></a>QRadioButton::QRadioButton(<a href="qwidget.html">QWidget</a>*parent, constchar*name=0)</h3>
<p>Constructs a radio button with no text.
<p>The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.
<h3 class="fn"><a name="e35d9c"></a>QRadioButton::QRadioButton(const<a href="qstring.html">QString</a>&amp;text, <a href="qwidget.html">QWidget</a>*parent, constchar*name=0)</h3>
<p>Constructs a radio button with a text.
<p>The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.
<h3 class="fn">void<a name="b82239"></a>QRadioButton::drawButton(<a href="qpainter.html">QPainter</a>*paint) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qbutton.html#13c577">QButton.</a>
<h3 class="fn">void<a name="fcdc76"></a>QRadioButton::drawButtonLabel(<a href="qpainter.html">QPainter</a>*p) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qbutton.html#c175f1">QButton.</a>
<h3 class="fn">void<a name="d1d657"></a>QRadioButton::focusInEvent(<a href="qfocusevent.html">QFocusEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#21a4b8">QWidget.</a>
<h3 class="fn">bool<a name="9114b5"></a>QRadioButton::hitButton(const<a href="qpoint.html">QPoint</a>&amp;pos)const <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qbutton.html#c0aff5">QButton.</a>
<h3 class="fn">bool<a name="da7700"></a>QRadioButton::isChecked()const</h3>
<p>Returns TRUE if the radio button is checked, or FALSE if it is not checked.
<p>See also  <a href="#0e50fc">setChecked</a>().
<h3 class="fn">void<a name="1feff9"></a>QRadioButton::resizeEvent(<a href="qresizeevent.html">QResizeEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#7d375f">QWidget.</a>
<h3 class="fn">void<a name="0e50fc"></a>QRadioButton::setChecked(boolcheck) <code>[virtual]</code></h3>
<p>Checks the radio button if <em>check</em> is TRUE, or unchecks it if <em>check</em>
is FALSE.
<p>Calling this function does not affect other radio buttons unless a radio
button group has been defined using the <a href="qbuttongroup.html">QButtonGroup</a> widget.
<p>See also  <a href="#da7700">isChecked</a>().
<p>Examples:
 <a href="xform-xform-cpp.html#setChecked">xform/xform.cpp</a>
 <a href="drawdemo-drawdemo-cpp.html#setChecked">drawdemo/drawdemo.cpp</a>
<h3 class="fn"><a href="qsize.html">QSize</a><a name="69cd2a"></a>QRadioButton::sizeHint()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#4511d1">QWidget.</a>
<h3 class="fn"><a href="qsizepolicy.html">QSizePolicy</a><a name="1183af"></a>QRadioButton::sizePolicy()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#23726d">QWidget.</a>
<h3 class="fn">void<a name="65ba96"></a>QRadioButton::updateMask() <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#b8a07f">QWidget.</a>
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>