📄 qradiobutton.3qt
字号:
'\" t.TH QRadioButton 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 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 or pixmap label.SH SYNOPSIS\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.in -1c.SS "Public Slots".in +1c.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 & )".br.ti -1c.BI "const QPixmap * \fBpixmap\fR () const".br.ti -1c.BI "virtual void \fBsetPixmap\fR ( const QPixmap & )".br.ti -1c.BI "QKeySequence \fBaccel\fR () const".br.ti -1c.BI "virtual void \fBsetAccel\fR ( const QKeySequence & )".br.ti -1c.BI "bool \fBisToggleButton\fR () const".br.ti -1c.BI "virtual void \fBsetDown\fR ( bool )".br.ti -1c.BI "bool \fBisDown\fR () const".br.ti -1c.BI "bool \fBisOn\fR () const".br.ti -1c.BI "ToggleState \fBstate\fR () const".br.ti -1c.BI "bool \fBautoRepeat\fR () const".br.ti -1c.BI "virtual void \fBsetAutoRepeat\fR ( bool )".br.ti -1c.BI "bool \fBisExclusiveToggle\fR () const".br.ti -1c.BI "QButtonGroup * \fBgroup\fR () const".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".in +1c.ti -1c.BI "bool \fBautoMask\fR - whether the radio button is automatically masked \fI(read " "only" ")\fR".br.ti -1c.BI "bool \fBchecked\fR - whether the radio button is checked".br.in -1c.SH DESCRIPTIONThe QRadioButton widget provides a radio button with a text or pixmap 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, 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..PPThe easiest way to implement a "one of many" choice is simply to put the radio buttons into QButtonGroup..PPWhenever 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..PPJust 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()..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QPushButton, QToolButton, GUI Design Handbook: Radio Button, and Basic Widgets..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 on to the QWidget constructor..SH "QRadioButton::QRadioButton ( const QString & text, QWidget * parent, const char * name = 0 )"Constructs a radio button with the text \fItext\fR..PPThe \fIparent\fR and \fIname\fR arguments are sent on to the QWidget constructor..SH "QKeySequence QButton::accel () const"Returns the accelerator associated with the button. See the "accel" property for details..SH "bool QButton::autoRepeat () const"Returns TRUE if autoRepeat is enabled; otherwise returns FALSE. See the "autoRepeat" property for details..SH "void QButton::clicked ()\fC [signal]\fR"This signal is emitted when the button is activated (i.e. first pressed down and then released when the mouse cursor is inside the button), when the accelerator key is typed or when animateClick() is called. This signal is \fInot\fR emitted if you call setDown()..PPThe QButtonGroup::clicked() signal does the same job, if you want to connect several buttons to the same slot..PPSee also pressed(), released(), toggled(), autoRepeat, and down..PPExamples:.)l chart/setdataform.cpp, listbox/listbox.cpp, network/clientserver/client/client.cpp, progressbar/progressbar.cpp, richtext/richtext.cpp, t2/main.cpp, and t4/main.cpp..SH "QButtonGroup * QButton::group () const"Returns the group that this button belongs to..PPIf the button is not a member of any QButtonGroup, this function returns 0..PPSee also QButtonGroup..SH "bool QRadioButton::isChecked () const"Returns TRUE if the radio button is checked; otherwise returns FALSE. See the "checked" property for details..SH "bool QButton::isDown () const"Returns TRUE if the button is pressed; otherwise returns FALSE. See the "down" property for details..SH "bool QButton::isExclusiveToggle () const"Returns TRUE if the button is an exclusive toggle; otherwise returns FALSE. See the "exclusiveToggle" property for details..SH "bool QButton::isOn () const"Returns TRUE if the button is toggled; otherwise returns FALSE. See the "on" property for details..SH "bool QButton::isToggleButton () const"Returns TRUE if the button is a toggle button; otherwise returns FALSE. See the "toggleButton" property for details..SH "const QPixmap * QButton::pixmap () const"Returns the pixmap shown on the button. See the "pixmap" property for details..SH "void QButton::pressed ()\fC [signal]\fR"This signal is emitted when the button is pressed down..PPSee also released() and clicked()..PPExamples:.)l network/httpd/httpd.cpp and popup/popup.cpp..SH "void QButton::released ()\fC [signal]\fR"This signal is emitted when the button is released..PPSee also pressed(), clicked(), and toggled()..SH "void QButton::setAccel ( const QKeySequence & )\fC [virtual]\fR"Sets the accelerator associated with the button. See the "accel" property for details..SH "void QButton::setAutoRepeat ( bool )\fC [virtual]\fR"Sets whether autoRepeat is enabled. See the "autoRepeat" property for details..SH "void QRadioButton::setChecked ( bool check )\fC [virtual slot]\fR"Sets whether the radio button is checked to \fIcheck\fR. See the "checked" property for details..SH "void QButton::setDown ( bool )\fC [virtual]\fR"Sets whether the button is pressed. See the "down" property for details..SH "void QButton::setPixmap ( const QPixmap & )\fC [virtual]\fR"Sets the pixmap shown on the button. See the "pixmap" property for details..SH "void QButton::setText ( const QString & )\fC [virtual]\fR"Sets the text shown on the button. See the "text" property for details..SH "ToggleState QButton::state () const"Returns the state of the toggle button. See the "toggleState" property for details..SH "void QButton::stateChanged ( int state )\fC [signal]\fR"This signal is emitted whenever a toggle button changes state. \fIstate\fR is On if the button is on, NoChange if it is in the" no change" state or Off if the button is off..PPThis may be the result of a user action, toggle() slot activation, setState(), or because setOn() was called..PPSee also clicked() and QButton::ToggleState..SH "QString QButton::text () const"Returns the text shown on the button. See the "text" property for details..SH "void QButton::toggle ()\fC [slot]\fR"Toggles the state of a toggle button..PPSee also on, setOn(), toggled(), and toggleButton..SH "void QButton::toggled ( bool on )\fC [signal]\fR"This signal is emitted whenever a toggle button changes status. \fIon\fR is TRUE if the button is on, or FALSE if the button is off..PPThis may be the result of a user action, toggle() slot activation, or because setOn() was called..PPSee also clicked()..PPExample: listbox/listbox.cpp..SS "Property Documentation".SH "QKeySequence accel"This property holds the accelerator associated with the button..PPThis property is 0 if there is no accelerator set. If you set this property to 0 then any current accelerator is removed..PPSet this property's value with setAccel() and get this property's value with accel()..SH "bool autoMask"This property holds whether the radio button is automatically masked..PPSee also QWidget::autoMask..SH "bool autoRepeat"This property holds whether autoRepeat is enabled..PPIf autoRepeat is enabled then the clicked() signal is emitted at regular intervals if the button is down. This property has no effect on toggle buttons. autoRepeat is off by default..PPSet this property's value with setAutoRepeat() and get this property's value with autoRepeat()..SH "bool checked"This property holds whether the radio button is checked..PPThis property will not effect any other radio buttons unless they have been placed in the same QButtonGroup. The default value is FALSE (unchecked)..PPSet this property's value with setChecked() and get this property's value with isChecked()..SH "QPixmap pixmap"This property holds the pixmap shown on the button..PPIf the pixmap is monochrome (i.e. it is a QBitmap or its depth is 1) and it does not have a mask, this property will set the pixmap to be its own mask. The purpose of this is to draw transparent bitmaps which are important for toggle buttons, for example..PPpixmap() returns 0 if no pixmap was set..PPSet this property's value with setPixmap() and get this property's value with pixmap()..SH "QString text"This property holds the text shown on the button..PPThis property will return a QString::null if the button has no text. If the text has an ampersand (&) in it, then an accelerator is automatically created for it using the character that follows the '&' as the accelerator key..PPThere is no default text..PPSet this property's value with setText() and get this property's value with text()..SH "SEE ALSO".BR http://doc.trolltech.com/qradiobutton.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qradiobutton.3qt) and the Qtversion (3.1.1).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -