📄 qbuttongroup.3qt
字号:
'\" t.TH QButtonGroup 3qt "29 October 2001" "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 NAMEQButtonGroup \- Organizes.br.PP\fC#include <qbuttongroup.h>\fR.PPInherits QGroupBox..PPInherited by QHButtonGroup and QVButtonGroup..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQButtonGroup\fR ( QWidget * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "\fBQButtonGroup\fR ( const QString & " "title" ", QWidget * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "\fBQButtonGroup\fR ( int " "columns" ", Orientation " "o" ", QWidget * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "\fBQButtonGroup\fR ( int " "columns" ", Orientation " "o" ", const QString & " "title" ", QWidget * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "bool \fBisExclusive\fR () const".br.ti -1c.BI "bool \fBisRadioButtonExclusive\fR () const".br.ti -1c.BI "virtual void \fBsetExclusive\fR ( bool ) ".br.ti -1c.BI "virtual void \fBsetRadioButtonExclusive\fR ( bool ) ".br.ti -1c.BI "int \fBinsert\fR ( QButton *, int " "id" "=-1 ) ".br.ti -1c.BI "void \fBremove\fR ( QButton * ) ".br.ti -1c.BI "QButton* \fBfind\fR ( int id ) const".br.ti -1c.BI "int \fBid\fR ( QButton * ) const".br.ti -1c.BI "int \fBcount\fR () const".br.ti -1c.BI "virtual void \fBsetButton\fR ( int id ) ".br.ti -1c.BI "virtual void \fBmoveFocus\fR ( int ) ".br.ti -1c.BI "QButton* \fBselected\fR () ".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBpressed\fR ( int id ) ".br.ti -1c.BI "void \fBreleased\fR ( int id ) ".br.ti -1c.BI "void \fBclicked\fR ( int id ) ".br.in -1c.SS "Protected Slots".in +1c.ti -1c.BI "void \fBbuttonPressed\fR () (internal)".br.ti -1c.BI "void \fBbuttonReleased\fR () (internal)".br.ti -1c.BI "void \fBbuttonClicked\fR () (internal)".br.ti -1c.BI "void \fBbuttonToggled\fR ( bool on ) (internal)".br.in -1c.SS "Properties".nf.TSl l l l l- - - - -l l l l l.Type Name READ WRITE Optionsbool exclusive isExclusive setExclusivebool radioButtonExclusive isRadioButtonExclusive setRadioButtonExclusive.TE.fi.SH DESCRIPTIONThe QButtonGroup widget organizes QButton widgets in a group..PPA button group widget makes it easier to deal with groups of buttons. A button in a button group is associated with a unique identifer. The button group emits a clicked() signal with this identifier when the button is clicked. Thus, a button group is an ideal solution when you have several similar buttons and want to connect all their clicked() signals, for example, to one slot..PPAn exclusive button group switches off all toggle buttons except the one that was clicked. A button group is by default non-exclusive. All radio buttons that are inserted, will be mutually exclusive even if the button group is non-exclusive..PPThere are two ways of using a button group:.IP 1The button group is a parent widget of a number of buttons, i.e. the button group is the parent argument in the button constructor. The buttons are assigned identifiers 0, 1, 2 etc. in the order they are created. A QButtonGroup can display a frame and a title because it inherits QGroupBox..IP 2The button group is an invisible widget and the contained buttons have some other parent widget. A button must then be manually inserted using the insert() function with an identifer..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QButton, QPushButton, QCheckBox and QRadioButton..PPExamples:.(lxform/xform.cpp i18n/main.cpp drawdemo/drawdemo.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QButtonGroup::QButtonGroup ( QWidget * parent=0, const char * name=0 )"Constructs a button group with no title..PPThe \fIparent\fR and \fIname\fR arguments are passed to the QWidget constructor..SH "QButtonGroup::QButtonGroup ( const QString & title, QWidget * parent=0, const char * name=0 )"Constructs a button group with a title..PPThe \fIparent\fR and \fIname\fR arguments are passed to the QWidget constructor..SH "QButtonGroup::QButtonGroup ( int strips, Orientation orientation, QWidget * parent=0, const char * name=0 )"Constructs a button group with no title. Child widgets will be arranged in \fIstrips\fR rows or columns (depending on \fIorientation).\fR.PPThe \fIparent\fR and \fIname\fR arguments are passed to the QWidget constructor..SH "QButtonGroup::QButtonGroup ( int strips, Orientation orientation, const QString & title, QWidget * parent=0, const char * name=0 )"Constructs a button group with a \fItitle.\fR Child widgets will be arranged in \fIstrips\fR rows or columns (depending on \fIorientation).\fR.PPThe \fIparent\fR and \fIname\fR arguments are passed to the QWidget constructor..SH "QButtonGroup::~QButtonGroup ()"Reimplemented for internal reasons; the API is not affected..SH "void QButtonGroup::clicked ( int id ) \fC[signal]\fR"This signal is emitted when a button in the group is clicked. The \fIid\fR argument is the button's identifier..SH "int QButtonGroup::count () const"Returns the number of buttons in the group..SH "QButton * QButtonGroup::find ( int id ) const"Finds and returns a pointer to the button with the specified identifier \fIid.\fR.PPReturns null if the button was not found..SH "int QButtonGroup::id ( QButton * button ) const"Returns the id of \fIbutton,\fR or -1 if \fIbutton\fR is not a member of this group..SH "int QButtonGroup::insert ( QButton * button, int id=-1 )"Inserts a button with the identifier \fIid\fR into the button group. Returns the button identifier..PPIt is not necessary to manually insert buttons that have this button group as their parent widget. An exception is when you want custom identifiers instead of the default 0, 1, 2 etc..PPThe button is assigned the identifier \fIid\fR or an automatically generated identifier. It works as follows: If \fIid\fR >= 0, this identifier is assigned. If \fIid\fR == -1 (default), the identifier is equal to the number of buttons in the group. If \fIid\fR is any other negative integer, for instance -2, a unique identifier (negative integer <= -2) is generated..PPInserting several buttons with \fIid\fR = -1 assigns the identifiers 0, 1, 2, etc..PPSee also find(), remove() and setExclusive()..PPExamples:.(lxform/xform.cpp.)l.SH "bool QButtonGroup::isExclusive () const"Returns TRUE if the button group is exclusive, otherwise FALSE..PPSee also setExclusive()..SH "bool QButtonGroup::isRadioButtonExclusive () const"Returns whether this button group will treat radio buttons as mutually exclusive. The default is TRUE..PPSee also setRadioButtonExclusive()..SH "void QButtonGroup::moveFocus ( int key ) \fC[virtual]\fR"Moves the keyboard focus according to \fIkey,\fR and if appropriate checks the new focus item..PPThis function does nothing unless the keyboard focus points to one of the button group members and \fIkey\fR is one of \fCKey_Up, Key_Down, Key_Left\fR and \fCKey_Right.\fR.SH "void QButtonGroup::pressed ( int id ) \fC[signal]\fR"This signal is emitted when a button in the group is pressed. The \fIid\fR argument is the button's identifier..SH "void QButtonGroup::released ( int id ) \fC[signal]\fR"This signal is emitted when a button in the group is released. The \fIid\fR argument is the button's identifier..SH "void QButtonGroup::remove ( QButton * button )"Removes a button from the button group..PPSee also insert()..SH "QButton * QButtonGroup::selected ()"Returns a pointer to the selected radio button in this group, if one exists, or 0 if there is no selected radio button in this group..PP\fBWarning: \fRIn future versions of Qt, the selected toggle button will be returned..SH "void QButtonGroup::setButton ( int id ) \fC[virtual]\fR"Sets the button with id \fIid\fR to be on, and if this is an exclusive group, all other button in the group to be off..SH "void QButtonGroup::setExclusive ( bool enable ) \fC[virtual]\fR"Sets the button group to be exclusive if \fIenable\fR is TRUE, or to be non-exclusive if \fIenable\fR is FALSE..PPAn exclusive button group switches off all other toggle buttons when one is switched on. This is ideal for groups of radio buttons. A non-exclusive group allow many buttons to be switched on at the same time..PPThe default setting is FALSE..PPSee also isExclusive()..SH "void QButtonGroup::setRadioButtonExclusive ( bool on ) \fC[virtual]\fR"If \fIon\fR is TRUE, this button group will treat radio buttons as mutually exclusive, and other buttons according to isExclusive()..SH "void QButtonGroup::buttonClicked () \fC[protected slot]\fR"For internal use only..SH "void QButtonGroup::buttonPressed () \fC[protected slot]\fR"For internal use only..SH "void QButtonGroup::buttonReleased () \fC[protected slot]\fR"For internal use only..SH "void QButtonGroup::buttonToggled ( bool on ) \fC[protected slot]\fR"For internal use only..SH "SEE ALSO".BR http://doc.trolltech.com/qbuttongroup.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 make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qbuttongroup.3qt) and the Qtversion (2.3.2).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -