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

The QCheckBox widget provides a checkbox with a text label. Más...

#include <qcheckbox.h>

Diagrama de herencias de QCheckBox
QButton QButton QWidget QWidget QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject FLCheckBox QDesignerCheckBox

Lista de todos los miembros.

Slots públicos

void setChecked (bool check)
void setChecked (bool check)

Métodos públicos

 QCheckBox (QWidget *parent, const char *name=0)
 QCheckBox (const QString &text, QWidget *parent, const char *name=0)
bool isChecked () const
void setNoChange ()
void setTristate (bool y=TRUE)
bool isTristate () const
QSize sizeHint () const
 QCheckBox (QWidget *parent, const char *name=0)
 QCheckBox (const QString &text, QWidget *parent, const char *name=0)
bool isChecked () const
void setNoChange ()
void setTristate (bool y=TRUE)
bool isTristate () const
QSize sizeHint () const

Métodos protegidos

void resizeEvent (QResizeEvent *)
void drawButton (QPainter *)
void drawButtonLabel (QPainter *)
void updateMask ()
bool hitButton (const QPoint &pos) const
void resizeEvent (QResizeEvent *)
void drawButton (QPainter *)
void drawButtonLabel (QPainter *)
void updateMask ()
bool hitButton (const QPoint &pos) const

Propiedades

bool checked
 whether the checkbox is checked
bool tristate
 whether the checkbox is a tri-state checkbox

Descripción detallada

The QCheckBox widget provides a checkbox with a text label.

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.

A QButtonGroup can be used to group check buttons visually.

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.

Atención:
The toggled() signal can not be trusted for tristate checkboxes.

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.

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

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

qchkbox-m.png
qchkbox-w.png
Ver también:
QButton QRadioButton Fowler: Check Box

Documentación del constructor y destructor

QCheckBox::QCheckBox ( QWidget parent,
const char *  name = 0 
)

Constructs a checkbox with no text.

The parent and name arguments are sent to the QWidget constructor.

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

Constructs a checkbox with text text.

The parent and name arguments are sent to the QWidget constructor.

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

Documentación de las funciones miembro

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

Reimplementado de QButton.

Reimplementado en FLCheckBox.

void QCheckBox::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.

Reimplementado en FLCheckBox.

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

Reimplementado de QButton.

void QCheckBox::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 QCheckBox::hitButton ( const QPoint pos) const [protected, virtual]

Reimplementado de QButton.

Reimplementado en FLCheckBox.

bool QCheckBox::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.

Reimplementado en FLCheckBox.

bool QCheckBox::isChecked ( ) const [inline]
bool QCheckBox::isChecked ( ) const
bool QCheckBox::isTristate ( ) const
bool QCheckBox::isTristate ( ) const
void QCheckBox::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 QCheckBox::resizeEvent ( QResizeEvent e) [protected, virtual]

Reimplementado de QWidget.

void QCheckBox::setChecked ( bool  check) [slot]
void QCheckBox::setChecked ( bool  check) [inline, slot]
void QCheckBox::setNoChange ( )

Sets the checkbox to the "no change" state.

Ver también:
setTristate()
void QCheckBox::setNoChange ( )
void QCheckBox::setTristate ( bool  y = TRUE)
void QCheckBox::setTristate ( bool  y = TRUE)
QSize QCheckBox::sizeHint ( ) const [virtual]

Reimplementado de QWidget.

QSize QCheckBox::sizeHint ( ) const [virtual]

Reimplementado de QWidget.

void QCheckBox::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.

void QCheckBox::updateMask ( ) [protected, virtual]

Reimplementado de QWidget.


Documentación de propiedades

bool QCheckBox::checked [read, write]

whether the checkbox is checked

The default is unchecked, i.e. FALSE.

bool QCheckBox::tristate [read, write]

whether the checkbox is a tri-state checkbox

The default is two-state, i.e. tri-state is FALSE.


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'