Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference |
|
The QCheckBox widget provides a check box with a text label. More...
#include <qcheckbox.h>
Inherits QButton.
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, while check-boxes provide "many of many" choices.
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.
Use QButtonGroup to group check-buttons visually.
Whenver a check box is checked or cleared, it emits the signal toggled(). Connect to this signal if you want to trigger an action each time the box changes state. Otherwise, use isChecked() to query whether or not a particular check box is selected.
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 setting nor unsetting an option. If you need that third state, enable it with setTristate() and use state() to query the current toggle state. When a tristate box changes state, it emits the stateChanged() signal.
See also QButton, QRadioButton, and Fowler: Check Box..
The parent and name arguments are sent to the QWidget constructor.
The parent and name arguments are sent to the QWidget constructor.
See also setAccel().
Returns TRUE if the button is auto-repeating, else FALSE.
The default is FALSE.
See also setAutoRepeat().
If the button is not a member of any QButtonGroup, this function returns 0.
See also setGroup() and QButtonGroup.
See also setChecked().
See also setDown().
See also setOn() and isToggleButton().
See also setToggleButton().
See also setTristate().
See also released() and clicked().
See also pressed(), clicked(), and toggled().
Setting a button text containing a shortcut character (for example the 'x' in E&xit) automatically defines an ALT+letter accelerator for the button. You only need to call this function in order to specify a custom accelerator.
Example:
QPushButton *b1 = new QPushButton;
b1->setText( "&OK" ); // sets accel ALT+'O'
QPushButton *b2 = new QPushButton;
b2->setPixmap( printIcon ); // pixmap instead of text
b2->setAccel( CTRL+'P' ); // custom accel
See also accel(), setText(), and QAccel.
When auto-repeat is enabled, the clicked() signal is emitted at regular intervals while the buttons is down.
setAutoRepeat() has no effect for toggle buttons.
See also isDown(), autoRepeat(), and clicked().
See also isChecked().
If the button is a toggle button, it is not toggled. Call toggle() as well if you need to do that. The pressed() and released() signals are not emitted by this function.
This method is provided in case you need to reimplement the mouse event handlers.
See also isDown(), setOn(), toggle(), and toggled().
See also setTristate().
If pixmap is monochrome (i.e. it is a QBitmap or its depth is 1) and it does not have a mask, this function sets the pixmap to be its own mask. The purpose of this is to draw transparent bitmaps, which is important for e.g. toggle buttons.
See also pixmap(), setText(), setAccel(), and QPixmap::mask().
If the text contains an ampersand, QButton creates an automatic accelerator for it, such as Alt-c for "&Cancel".
See also text(), setPixmap(), setAccel(), and QPixmap::mask().
Use tristate check boxes whenever you need to give the user the option of neither setting nor unsetting an option. A typical example is the "Italic" check box in the font dialog of a word processor when the marked text is partially Italic and partially not.
See also isTristate(), setNoChange(), stateChanged(), and state().
See also ToggleState, ToggleType, and setState().
This may be the result of a user action, toggle() slot activation, setState(), or because setOn() was called.
See also clicked().
See also setText().
This may be the result of a user action, toggle() slot activation, or because setOn() was called.
See also clicked().
This file is part of the Qtopia platform, copyright © 1995-2005 Trolltech, all rights reserved.
| Copyright © 2005 Trolltech | Trademarks | Qtopia version 2.2.0
|