.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.
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.
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.
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().
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.