QRadioButton - Radio button with a text label
#include <qradiobutton.h>
Inherits QButton.
Public Members
QRadioButton ( QWidget * parent, const char * name=0 )
QRadioButton ( const QString & text, QWidget * parent,
const char * name=0 )
bool isChecked () const
virtual void setChecked ( bool check )
Important Inherited Members
QString text () const
virtual void setText ( const QString & text )
QString text () const
const QPixmap* pixmap () const
virtual void setPixmap ( const QPixmap & pixmap )
int accel () const
virtual void setAccel ( int key )
bool isToggleButton () const
virtual void setDown ( bool enable )
bool isDown () const
bool isOn () const
bool autoRepeat () const
bool isExclusiveToggle () const
QButtonGroup* group () const
virtual void setAutoRepeat ( bool enable )
void toggle ()
void pressed ()
void released ()
void clicked ()
void toggled ( bool on )
void stateChanged ( int state )
Properties
Type Name READ WRITE Options
--------------------------------------------------
bool checked isChecked setChecked
DESCRIPTION
The QRadioButton widget provides a radio button with a
text 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,
while radio buttons provide a "one of many" choice. In a
group of radio buttons, only one button at a time can be
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.
[Image Omitted]
[Image Omitted]
See also QPushButton, QToolButton and GUI Design Handbook:
Radio Button
Examples: xform/xform.cpp drawdemo/drawdemo.cpp
MEMBER FUNCTION DOCUMENTATION
QRadioButton::QRadioButton ( QWidget * parent, const char *
name=0 )
Constructs a radio button with no text.
The parent and name arguments are sent to the QWidget
constructor.
QRadioButton::QRadioButton ( const QString & text, QWidget *
parent, const char * name=0 )
Constructs a radio button with a text.
The parent and name arguments are sent to the QWidget
constructor.
void QRadioButton::drawButton ( QPainter * paint ) [virtual
protected]
Reimplemented for internal reasons; the API is not
affected.
Reimplemented from QButton.
void QRadioButton::drawButtonLabel ( QPainter * p ) [virtual
protected]
Reimplemented for internal reasons; the API is not
affected.
void QRadioButton::focusInEvent ( QFocusEvent * e ) [virtual
protected]
Reimplemented for internal reasons; the API is not
affected.
Reimplemented from QWidget.
bool QRadioButton::hitButton ( const QPoint & pos ) const
[virtual protected]
Reimplemented for internal reasons; the API is not
affected.
Reimplemented from QButton.
bool QRadioButton::isChecked () const
Returns TRUE if the radio button is checked, or FALSE if
it is not checked.
See also setChecked().
void QRadioButton::resizeEvent ( QResizeEvent * e ) [virtual
protected]
Reimplemented for internal reasons; the API is not
affected.
Reimplemented from QWidget.
void QRadioButton::setChecked ( bool check ) [virtual]
Checks the radio button if check is TRUE, or unchecks it
if check is FALSE.
Calling this function does not affect other radio buttons
unless a radio button group has been defined using the
QButtonGroup widget.
See also isChecked().
Examples: xform/xform.cpp drawdemo/drawdemo.cpp
QSize QRadioButton::sizeHint () const [virtual]
Reimplemented for internal reasons; the API is not
affected.
Reimplemented from QWidget.
QSizePolicy QRadioButton::sizePolicy () const [virtual]
Reimplemented for internal reasons; the API is not
affected.
Reimplemented from QWidget.
Reimplemented for internal reasons; the API is not
affected.
Reimplemented from QWidget.
SEE ALSO
http://doc.trolltech.com/qradiobutton.html
http://www.trolltech.com/faq/tech.html
COPYRIGHT
Copyright 1992-2001 Trolltech AS,
http://www.trolltech.com. See the license file included
in the distribution for a complete license statement.
AUTHOR
Generated automatically from the source code.
BUGS
If you find a bug in Qt, please report it as described in
http://doc.trolltech.com/bughowto.html. Good bug reports
make our job much simpler. Thank you.
In case of content or formattting problems with this
manual page, please report them to qt-bugs@trolltech.com.
Please include the name of the manual page
(qradiobutton.3qt) and the Qt version (2.3.1).
Man(1) output converted with
man2html