Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference |
|
The QRadioButton widget provides a radio button with a text label. More...
#include <qradiobutton.h>
Inherits QButton.
QRadioButton and QCheckBox 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.
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.
The easiest way to implement a "one of many" choice, is to simply stick the radio buttons into QButtonGroup.
Whenver a button is switched on or off, it emits the signal toggled(). Connect to this signal if you want to trigger an action each time the button changes state. Otherwise, use isChecked() to query whether or not a particular button is selected.
See also QPushButton, QToolButton, and GUI Design Handbook: Radio Button.
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 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().
Calling this function does not affect other radio buttons unless a radio button group has been defined using the QButtonGroup widget.
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().
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().
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
|