summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqcheckbox.3qt
blob: 96d6807157b22a6c4b5b9699608b10f22a17f1a1 (plain)
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
'\" t
.TH QCheckBox 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QCheckBox \- Checkbox with a text label
.SH SYNOPSIS
\fC#include <ntqcheckbox.h>\fR
.PP
Inherits QButton.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQCheckBox\fR ( TQWidget * parent, const char * name = 0 )"
.br
.ti -1c
.BI "\fBQCheckBox\fR ( const TQString & text, TQWidget * parent, const char * name = 0 )"
.br
.ti -1c
.BI "bool \fBisChecked\fR () const"
.br
.ti -1c
.BI "void \fBsetNoChange\fR ()"
.br
.ti -1c
.BI "void \fBsetTristate\fR ( bool y = TRUE )"
.br
.ti -1c
.BI "bool \fBisTristate\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBsetChecked\fR ( bool check )"
.br
.in -1c
.SS "Important Inherited Members"
.in +1c
.ti -1c
.BI "TQString \fBtext\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetText\fR ( const TQString & )"
.br
.ti -1c
.BI "const QPixmap * \fBpixmap\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetPixmap\fR ( const QPixmap & )"
.br
.ti -1c
.BI "QKeySequence \fBaccel\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetAccel\fR ( const QKeySequence & )"
.br
.ti -1c
.BI "bool \fBisToggleButton\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetDown\fR ( bool )"
.br
.ti -1c
.BI "bool \fBisDown\fR () const"
.br
.ti -1c
.BI "bool \fBisOn\fR () const"
.br
.ti -1c
.BI "ToggleState \fBstate\fR () const"
.br
.ti -1c
.BI "bool \fBautoRepeat\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetAutoRepeat\fR ( bool )"
.br
.ti -1c
.BI "bool \fBisExclusiveToggle\fR () const"
.br
.ti -1c
.BI "QButtonGroup * \fBgroup\fR () const"
.br
.ti -1c
.BI "void \fBtoggle\fR ()"
.br
.ti -1c
.BI "void \fBpressed\fR ()"
.br
.ti -1c
.BI "void \fBreleased\fR ()"
.br
.ti -1c
.BI "void \fBclicked\fR ()"
.br
.ti -1c
.BI "void \fBtoggled\fR ( bool on )"
.br
.ti -1c
.BI "void \fBstateChanged\fR ( int state )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "bool \fBautoMask\fR - whether the checkbox is automatically masked  \fI(read " "only" ")\fR"
.br
.ti -1c
.BI "bool \fBchecked\fR - whether the checkbox is checked"
.br
.ti -1c
.BI "bool \fBtristate\fR - whether the checkbox is a tri-state checkbox"
.br
.in -1c
.SH DESCRIPTION
The QCheckBox widget provides a checkbox with a text label.
.PP
QCheckBox and QRadioButton 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. Radio buttons define a "one of many" choice, whereas checkboxes provide" many of many" choices.
.PP
A QButtonGroup can be used to group check buttons visually.
.PP
Whenever a checkbox is checked or cleared it emits the signal toggled(). Connect to this signal if you want to trigger an action each time the checkbox changes state. You can use isChecked() to query whether or not a checkbox is checked.
.PP
\fBWarning:\fR The toggled() signal can not be trusted for tristate checkboxes.
.PP
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 setTristate() and use state() to query the current toggle state. When a tristate checkbox changes state, it emits the stateChanged() signal.
.PP
Just like QPushButton, a checkbox can display text or a pixmap. The text can be set in the constructor or with setText(); the pixmap is set with setPixmap().
.PP
.ce 1
.B "[Image Omitted]"
.PP

.ce 1
.B "[Image Omitted]"
.PP
See also QButton, QRadioButton, Fowler: Check Box, and Basic Widgets.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QCheckBox::QCheckBox ( TQWidget * parent, const char * name = 0 )"
Constructs a checkbox with no text.
.PP
The \fIparent\fR and \fIname\fR arguments are sent to the TQWidget constructor.
.SH "QCheckBox::QCheckBox ( const TQString & text, TQWidget * parent, const char * name = 0 )"
Constructs a checkbox with text \fItext\fR.
.PP
The \fIparent\fR and \fIname\fR arguments are sent to the TQWidget constructor.
.SH "QKeySequence QButton::accel () const"
Returns the accelerator associated with the button. See the "accel" property for details.
.SH "bool QButton::autoRepeat () const"
Returns TRUE if autoRepeat is enabled; otherwise returns FALSE. See the "autoRepeat" property for details.
.SH "void QButton::clicked ()\fC [signal]\fR"
This signal is emitted when the button is activated (i.e. first pressed down and then released when the mouse cursor is inside the button), when the accelerator key is typed or when animateClick() is called. This signal is \fInot\fR emitted if you call setDown().
.PP
The QButtonGroup::clicked() signal does the same job, if you want to connect several buttons to the same slot.
.PP
\fBWarning:\fR Don't launch a model dialog in response to this signal for a button that has autoRepeat turned on.
.PP
See also pressed(), released(), toggled(), autoRepeat, and down.
.PP
Examples:
.)l chart/setdataform.cpp, listbox/listbox.cpp, network/clientserver/client/client.cpp, progressbar/progressbar.cpp, richtext/richtext.cpp, t2/main.cpp, and t4/main.cpp.
.SH "QButtonGroup * QButton::group () const"
Returns the group that this button belongs to.
.PP
If the button is not a member of any QButtonGroup, this function returns 0.
.PP
See also QButtonGroup.
.SH "bool QCheckBox::isChecked () const"
Returns TRUE if the checkbox is checked; otherwise returns FALSE. See the "checked" property for details.
.SH "bool QButton::isDown () const"
Returns TRUE if the button is pressed; otherwise returns FALSE. See the "down" property for details.
.SH "bool QButton::isExclusiveToggle () const"
Returns TRUE if the button is an exclusive toggle; otherwise returns FALSE. See the "exclusiveToggle" property for details.
.SH "bool QButton::isOn () const"
Returns TRUE if the button is toggled; otherwise returns FALSE. See the "on" property for details.
.SH "bool QButton::isToggleButton () const"
Returns TRUE if the button is a toggle button; otherwise returns FALSE. See the "toggleButton" property for details.
.SH "bool QCheckBox::isTristate () const"
Returns TRUE if the checkbox is a tri-state checkbox; otherwise returns FALSE. See the "tristate" property for details.
.SH "const QPixmap * QButton::pixmap () const"
Returns the pixmap shown on the button. See the "pixmap" property for details.
.SH "void QButton::pressed ()\fC [signal]\fR"
This signal is emitted when the button is pressed down.
.PP
See also released() and clicked().
.PP
Examples:
.)l network/httpd/httpd.cpp and popup/popup.cpp.
.SH "void QButton::released ()\fC [signal]\fR"
This signal is emitted when the button is released.
.PP
See also pressed(), clicked(), and toggled().
.SH "void QButton::setAccel ( const QKeySequence & )\fC [virtual]\fR"
Sets the accelerator associated with the button. See the "accel" property for details.
.SH "void QButton::setAutoRepeat ( bool )\fC [virtual]\fR"
Sets whether autoRepeat is enabled. See the "autoRepeat" property for details.
.SH "void QCheckBox::setChecked ( bool check )\fC [slot]\fR"
Sets whether the checkbox is checked to \fIcheck\fR. See the "checked" property for details.
.SH "void QButton::setDown ( bool )\fC [virtual]\fR"
Sets whether the button is pressed. See the "down" property for details.
.SH "void QCheckBox::setNoChange ()"
Sets the checkbox to the "no change" state.
.PP
See also tristate.
.SH "void QButton::setPixmap ( const QPixmap & )\fC [virtual]\fR"
Sets the pixmap shown on the button. See the "pixmap" property for details.
.SH "void QButton::setText ( const TQString & )\fC [virtual]\fR"
Sets the text shown on the button. See the "text" property for details.
.SH "void QCheckBox::setTristate ( bool y = TRUE )"
Sets whether the checkbox is a tri-state checkbox to \fIy\fR. See the "tristate" property for details.
.SH "ToggleState QButton::state () const"
Returns the state of the toggle button. See the "toggleState" property for details.
.SH "void QButton::stateChanged ( int state )\fC [signal]\fR"
This signal is emitted whenever a toggle button changes state. \fIstate\fR is On if the button is on, NoChange if it is in the" no change" state or Off if the button is off.
.PP
This may be the result of a user action, toggle() slot activation, setState(), or because setOn() was called.
.PP
See also clicked() and QButton::ToggleState.
.SH "TQString QButton::text () const"
Returns the text shown on the button. See the "text" property for details.
.SH "void QButton::toggle ()\fC [slot]\fR"
Toggles the state of a toggle button.
.PP
See also on, setOn(), toggled(), and toggleButton.
.SH "void QButton::toggled ( bool on )\fC [signal]\fR"
This signal is emitted whenever a toggle button changes status. \fIon\fR is TRUE if the button is on, or FALSE if the button is off.
.PP
This may be the result of a user action, toggle() slot activation, or because setOn() was called.
.PP
See also clicked().
.PP
Example: listbox/listbox.cpp.
.SS "Property Documentation"
.SH "QKeySequence accel"
This property holds the accelerator associated with the button.
.PP
This property is 0 if there is no accelerator set. If you set this property to 0 then any current accelerator is removed.
.PP
Set this property's value with setAccel() and get this property's value with accel().
.SH "bool autoMask"
This property holds whether the checkbox is automatically masked.
.PP
See also TQWidget::autoMask.
.SH "bool autoRepeat"
This property holds whether autoRepeat is enabled.
.PP
If autoRepeat is enabled then the clicked() signal is emitted at regular intervals if the button is down. This property has no effect on toggle buttons. autoRepeat is off by default.
.PP
Set this property's value with setAutoRepeat() and get this property's value with autoRepeat().
.SH "bool checked"
This property holds whether the checkbox is checked.
.PP
The default is unchecked, i.e. FALSE.
.PP
Set this property's value with setChecked() and get this property's value with isChecked().
.SH "QPixmap pixmap"
This property holds the pixmap shown on the button.
.PP
If the pixmap is monochrome (i.e. it is a QBitmap or its depth is 1) and it does not have a mask, this property will set the pixmap to be its own mask. The purpose of this is to draw transparent bitmaps which are important for toggle buttons, for example.
.PP
pixmap() returns 0 if no pixmap was set.
.PP
Set this property's value with setPixmap() and get this property's value with pixmap().
.SH "TQString text"
This property holds the text shown on the button.
.PP
This property will return a TQString::null if the button has no text. If the text has an ampersand (&) in it, then an accelerator is automatically created for it using the character that follows the '&' as the accelerator key. Any previous accelerator will be overwritten, or cleared if no accelerator is defined by the text.
.PP
There is no default text.
.PP
Set this property's value with setText() and get this property's value with text().
.SH "bool tristate"
This property holds whether the checkbox is a tri-state checkbox.
.PP
The default is two-state, i.e. tri-state is FALSE.
.PP
Set this property's value with setTristate() and get this property's value with isTristate().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqcheckbox.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqcheckbox.3qt) and the Qt
version (3.3.8).