📄 qradiobutton.3qt
字号:
.TH QRadioButton 3qt "3 September 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQRadioButton \- Radio button with a text label.SH SYNOPSIS.br.PP\fC#include <qradiobutton.h>\fR.PPInherits QButton..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQRadioButton\fR ( QWidget * " "parent" ", const char * " "name" "=0 ) ".br.ti -1c.BI "\fBQRadioButton\fR ( const QString & " "text" ", QWidget * " "parent" ", const char * " "name" "=0 ) ".br.ti -1c.BI "bool \fBisChecked\fR () const".br.ti -1c.BI "virtual void \fBsetChecked\fR ( bool check ) ".br.in -1c.SS "Important Inherited Members".in +1c.ti -1c.BI "QString \fBtext\fR () const".br.ti -1c.BI "virtual void \fBsetText\fR ( const QString & text ) ".br.ti -1c.BI "QString \fBtext\fR () const".br.ti -1c.BI "const QPixmap* \fBpixmap\fR () const".br.ti -1c.BI "virtual void \fBsetPixmap\fR ( const QPixmap & pixmap ) ".br.ti -1c.BI "int \fBaccel\fR () const".br.ti -1c.BI "virtual void \fBsetAccel\fR ( int key ) ".br.ti -1c.BI "bool \fBisToggleButton\fR () const".br.ti -1c.BI "virtual void \fBsetDown\fR ( bool enable ) ".br.ti -1c.BI "bool \fBisDown\fR () const".br.ti -1c.BI "bool \fBisOn\fR () const".br.ti -1c.BI "bool \fBautoRepeat\fR () const".br.ti -1c.BI "bool \fBisExclusiveToggle\fR () const".br.ti -1c.BI "QButtonGroup* \fBgroup\fR () const".br.ti -1c.BI "virtual void \fBsetAutoRepeat\fR ( bool enable ) ".br.ti -1c.BI "void \fBtoggle\fR () ".br.ti -1c.BI "void \fBpressed\fR () ".br.ti -1c.BI "void \fBreleased\fR () ".br.ti -1c.BI "void \fBclicked\fR () ".br.ti -1c.BI "void \fBtoggled\fR ( bool on ) ".br.ti -1c.BI "void \fBstateChanged\fR ( int state ) ".br.in -1c.SS "Properties"<table border=1 cellpadding=3 cellspacing=0> <tr><th>Type<th>Name<th>READ<th>WRITE<th>Options <tr><td>bool<td>checked<td>isChecked<td>setChecked<td> </table>.SH DESCRIPTIONThe QRadioButton widget provides a radio button with a text label..PPQRadioButton 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..PPWhile 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..PPThe easiest way to implement a "one of many" choice, is to simply stick the radio buttons into QButtonGroup..PPWhenver 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..PP<img src=qradiobt-m.png> <img src=qradiobt-w.png>.PPSee also QPushButton, QToolButton and GUI Design Handbook: Radio Button.PPExamples:.(lxform/xform.cpp drawdemo/drawdemo.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QRadioButton::QRadioButton ( QWidget * parent, const char * name=0 )"Constructs a radio button with no text..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor..SH "QRadioButton::QRadioButton ( const QString & text, QWidget * parent, const char * name=0 )"Constructs a radio button with a text..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor..SH "void QRadioButton::drawButton ( QPainter * paint ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QButton..SH "void QRadioButton::drawButtonLabel ( QPainter * p ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QButton..SH "void QRadioButton::focusInEvent ( QFocusEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "bool QRadioButton::hitButton ( const QPoint & pos ) const \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QButton..SH "bool QRadioButton::isChecked () const"Returns TRUE if the radio button is checked, or FALSE if it is not checked..PPSee also setChecked()..SH "void QRadioButton::resizeEvent ( QResizeEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QRadioButton::setChecked ( bool check ) \fC[virtual]\fR"Checks the radio button if \fIcheck\fR is TRUE, or unchecks it if \fIcheck\fR is FALSE..PPCalling this function does not affect other radio buttons unless a radio button group has been defined using the QButtonGroup widget..PPSee also isChecked()..PPExamples:.(lxform/xform.cpp drawdemo/drawdemo.cpp.)l.SH "QSize QRadioButton::sizeHint () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QSizePolicy QRadioButton::sizePolicy () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QRadioButton::updateMask () \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "SEE ALSO".BR http://doc.trolltech.com/qradiobutton.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -