Eneboo - Documentación para desarrolladores
Slots públicos | Métodos públicos | Métodos protegidos | Propiedades
Referencia de la Clase QRadioButton

The QRadioButton widget provides a radio button with a text or pixmap label. Más...

#include <qradiobutton.h>

Diagrama de herencias de QRadioButton
QButton QButton QWidget QWidget QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QDesignerRadioButton

Lista de todos los miembros.

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

Descripción detallada

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

qradiobt-m.png
qradiobt-w.png

text, setText, text, pixmap, setPixmap, accel, setAccel, isToggleButton, setDown, isDown, isOn, state, autoRepeat, isExclusiveToggle, group, setAutoRepeat, toggle, pressed, released, clicked, toggled, state stateChanged

Ver también:
QPushButton QToolButton GUI Design Handbook: Radio Button

Documentación del constructor y destructor

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.

QRadioButton::QRadioButton ( const QString text,
QWidget parent,
const char *  name = 0 
)

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 
)
QRadioButton::QRadioButton ( const QString text,
QWidget parent,
const char *  name = 0 
)

Documentación de las funciones miembro

void QRadioButton::drawButton ( QPainter paint) [protected, virtual]

Reimplementado de QButton.

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

Ver también:
drawButtonLabel(), paintEvent()

Reimplementado de QButton.

void QRadioButton::drawButtonLabel ( QPainter p) [protected, virtual]

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

Ver también:
drawButton(), paintEvent()

Reimplementado de QButton.

bool QRadioButton::hitButton ( const QPoint pos) const [protected, virtual]

Reimplementado de QButton.

bool QRadioButton::hitButton ( const QPoint pos) const [protected, virtual]

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.

Ver también:
moveEvent(), event(), resize(), QResizeEvent, paintEvent()

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]
QSize QRadioButton::sizeHint ( ) const [virtual]

Reimplementado de QWidget.

QSize QRadioButton::sizeHint ( ) const [virtual]

Reimplementado de QWidget.

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.

Ver también:
setAutoMask(), updateMask(), setMask(), clearMask()

Reimplementado de QWidget.


Documentación de propiedades

bool QRadioButton::checked [read, write]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'