Eneboo - Documentación para desarrolladores
|
The QRadioButton widget provides a radio button with a text or pixmap label. Más...
#include <qradiobutton.h>
Slots públicos | |
virtual void | setChecked (bool check) |
virtual void | setChecked (bool check) |
Métodos públicos | |
QRadioButton (QWidget *parent, const char *name=0) | |
QRadioButton (const QString &text, QWidget *parent, const char *name=0) | |
bool | isChecked () const |
QSize | sizeHint () const |
QRadioButton (QWidget *parent, const char *name=0) | |
QRadioButton (const QString &text, QWidget *parent, const char *name=0) | |
bool | isChecked () const |
QSize | sizeHint () const |
Métodos protegidos | |
bool | hitButton (const QPoint &) const |
void | drawButton (QPainter *) |
void | drawButtonLabel (QPainter *) |
void | updateMask () |
void | resizeEvent (QResizeEvent *) |
bool | hitButton (const QPoint &) const |
void | drawButton (QPainter *) |
void | drawButtonLabel (QPainter *) |
void | updateMask () |
void | resizeEvent (QResizeEvent *) |
Propiedades | |
bool | checked |
The QRadioButton widget provides a radio button with a text or pixmap label.
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, whereas radio buttons provide a "one of many" choice. In a group of radio buttons only one radio button at a time can be checked; if the user selects another button, the previously selected button is switched off.
The easiest way to implement a "one of many" choice is simply to put the radio buttons into QButtonGroup.
Whenever 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 see if a particular button is selected.
Just like QPushButton, a radio button can display text or a pixmap. The text can be set in the constructor or with setText(); the pixmap is set with setPixmap().
text, setText, text, pixmap, setPixmap, accel, setAccel, isToggleButton, setDown, isDown, isOn, state, autoRepeat, isExclusiveToggle, group, setAutoRepeat, toggle, pressed, released, clicked, toggled, state stateChanged
QRadioButton::QRadioButton | ( | QWidget * | parent, |
const char * | name = 0 |
||
) |
Constructs a radio button with no text.
The parent and name arguments are sent on to the QWidget constructor.
Constructs a radio button with the text text.
The parent and name arguments are sent on to the QWidget constructor.
QRadioButton::QRadioButton | ( | QWidget * | parent, |
const char * | name = 0 |
||
) |
void QRadioButton::drawButton | ( | QPainter * | ) | [protected, virtual] |
Draws the button. The default implementation does nothing.
This virtual function is reimplemented by subclasses to draw real buttons. At some point, these reimplementations should call drawButtonLabel().
Reimplementado de QButton.
void QRadioButton::drawButtonLabel | ( | QPainter * | ) | [protected, virtual] |
Draws the button text or pixmap.
This virtual function is reimplemented by subclasses to draw real buttons. It is invoked by drawButton().
Reimplementado de QButton.
Reimplementado de QButton.
Returns TRUE if pos is inside the clickable button rectangle; otherwise returns FALSE.
By default, the clickable area is the entire widget. Subclasses may reimplement it, though.
Reimplementado de QButton.
bool QRadioButton::isChecked | ( | ) | const |
bool QRadioButton::isChecked | ( | ) | const [inline] |
void QRadioButton::resizeEvent | ( | QResizeEvent * | ) | [protected, virtual] |
This event handler can be reimplemented in a subclass to receive widget resize events. When resizeEvent() is called, the widget already has its new geometry. The old size is accessible through QResizeEvent::oldSize().
The widget will be erased and receive a paint event immediately after processing the resize event. No drawing need be (or should be) done inside this handler.
Widgets that have been created with the WNoAutoErase
flag will not be erased. Nevertheless, they will receive a paint event for their entire area afterwards. Again, no drawing needs to be done inside this handler.
The default implementation calls updateMask() if the widget has automatic masking enabled.
Reimplementado de QWidget.
void QRadioButton::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Reimplementado de QWidget.
virtual void QRadioButton::setChecked | ( | bool | check | ) | [virtual, slot] |
void QRadioButton::setChecked | ( | bool | check | ) | [virtual, slot] |
void QRadioButton::updateMask | ( | ) | [protected, virtual] |
Reimplementado de QWidget.
void QRadioButton::updateMask | ( | ) | [protected, virtual] |
This function can be reimplemented in a subclass to support transparent widgets. It should be called whenever a widget changes state in a way that means that the shape mask must be recalculated.
Reimplementado de QWidget.
bool QRadioButton::checked [read, write] |