⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qbutton.3qt

📁 qt-embedded-2.3.8.tar.gz源码
💻 3QT
📖 第 1 页 / 共 2 页
字号:
.PPSee also setAccel()..SH "void QButton::animateClick () \fC[slot]\fR"Performs an animated click: The button is pressed and a short while later released..PPpressed(), released(), clicked(), toggled(), and stateChanged() signals are emitted as appropriate..PPThis function does nothing if the button is disabled..PPSee also setAccel()..SH "bool QButton::autoRepeat () const"Returns TRUE if the button is auto-repeating, else FALSE..PPThe default is FALSE..PPSee also setAutoRepeat()..SH "bool QButton::autoResize () const"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPStrange pre-layout stuff..PPReturns TRUE if auto-resizing is enabled, or FALSE if auto-resizing is disabled..PPAuto-resizing is disabled by default..PPSee also setAutoResize()..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, or when the accelerator key is typed, or when animateClick() is called..PPSee also pressed(), released() and toggled()..SH "void QButton::drawButton ( QPainter * ) \fC[virtual protected]\fR"Draws the button. The default implementation does nothing..PPThis virtual function is reimplemented by subclasses to draw real buttons. At some point in time, these reimplementations are supposed to call drawButtonLabel()..PPSee also drawButtonLabel() and paintEvent()..PPReimplemented in QToolButton, QCheckBox, QPushButton and QRadioButton..SH "void QButton::drawButtonLabel ( QPainter * ) \fC[virtual protected]\fR"Draws the button text or pixmap..PPThis virtual function is reimplemented by subclasses to draw real buttons. It's invoked by drawButton()..PPSee also drawButton() and paintEvent()..PPReimplemented in QRadioButton, QPushButton, QCheckBox and QToolButton..SH "void QButton::enabledChange ( bool e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QButton::focusInEvent ( QFocusEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "bool QButton::focusNextPrevChild ( bool next ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QButton::focusOutEvent ( QFocusEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QButtonGroup * QButton::group () const"Returns a pointer to the group of which this button is a member..PPIf the button is not a member of any QButtonGroup, this function returns 0..PPSee also setGroup() and QButtonGroup..SH "bool QButton::hitButton ( const QPoint & pos ) const \fC[virtual protected]\fR"Returns TRUE if \fIpos\fR is inside the clickable button rectangle, or FALSE if it is outside..PPPer default, the clickable area is the entire widget. Subclasses may reimplement it, though..PPReimplemented in QRadioButton..SH "bool QButton::isDown () const"Returns TRUE if the button pressed down, or FALSE if it is standing up..PPSee also setDown()..SH "bool QButton::isExclusiveToggle () const"Returns TRUE if this button behaves exclusively inside a QButtonGroup. In that case, this button can only be toggled off by another button being toggled on..SH "bool QButton::isOn () const"Returns TRUE if this toggle button is switched on, or FALSE if it is switched off..PPSee also setOn() and isToggleButton()..PPExamples:.(lqmag/qmag.cpp.)l.SH "bool QButton::isToggleButton () const"Returns TRUE if the button is a toggle button..PPSee also setToggleButton()..SH "void QButton::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QButton::keyReleaseEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QButton::mouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QButton::mousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QButton::mouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QButton::paintEvent ( QPaintEvent * event ) \fC[virtual protected]\fR"Handles paint events for buttons. Small and typically complex buttons (less than 300x100 pixels) are painted double-buffered to reduce flicker. The actually drawing is done in the virtual functions drawButton() and drawButtonLabel()..PPSee also drawButton() and drawButtonLabel()..PPReimplemented from QWidget..SH "const QPixmap * QButton::pixmap () const"Returns the button pixmap, or 0 if the button has no pixmap..SH "void QButton::pressed () \fC[signal]\fR"This signal is emitted when the button is pressed down..PPSee also released() and clicked()..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 ( int key ) \fC[virtual]\fR"Specifies an accelerator \fIkey\fR for the button, or removes the accelerator if \fIkey\fR is 0..PPSetting a button text containing a shortcut character (for example the 'x' in E&xit) automatically defines an ALT+letter accelerator for the button. You only need to call this function in order to specify a custom accelerator..PPExample:.PP.nf.br    QPushButton *b1 = new QPushButton;.br    b1->setText( "&OK" );               // sets accel ALT+'O'.br.br    QPushButton *b2 = new QPushButton;.br    b2->setPixmap( printIcon );         // pixmap instead of text.br    b2->setAccel( CTRL+'P' );           // custom accel.fi.PPSee also accel(), setText() and QAccel..SH "void QButton::setAutoRepeat ( bool enable ) \fC[virtual]\fR"Turns on auto-repeat for the button if \fIenable\fR is TRUE, or turns it off if \fIenable\fR is FALSE..PPWhen auto-repeat is enabled, the clicked() signal is emitted at regular intervals while the buttons is down..PPsetAutoRepeat() has no effect for toggle buttons..PPSee also isDown(), autoRepeat() and clicked()..SH "void QButton::setAutoResize ( bool enable ) \fC[virtual]\fR"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPStrange pre-layout stuff..PPEnables auto-resizing if \fIenable\fR is TRUE, or disables it if \fIenable\fR is FALSE..PPWhen auto-resizing is enabled, the button will resize itself whenever the contents change..PPSee also autoResize() and adjustSize()..SH "void QButton::setDown ( bool enable ) \fC[virtual]\fR"Sets the state of the button to pressed down if \fIenable\fR is TRUE or to standing up if \fIenable\fR is FALSE..PPIf the button is a toggle button, it is \fInot\fR toggled. Call toggle() as well if you need to do that. The pressed() and released() signals are not emitted by this function..PPThis method is provided in case you need to reimplement the mouse event handlers..PPSee also isDown(), setOn(), toggle() and toggled()..SH "void QButton::setOn ( bool enable ) \fC[protected]\fR"Switches a toggle button on if \fIenable\fR is TRUE or off if \fIenable\fR is FALSE. This function should be called only for toggle buttons..PPSee also isOn() and isToggleButton()..SH "void QButton::setPixmap ( const QPixmap & pixmap ) \fC[virtual]\fR"Sets the button to display \fIpixmap\fR.PPIf \fIpixmap\fR is monochrome (i.e. it is a QBitmap or its depth is 1) and it does not have a mask, this function sets the pixmap to be its own mask. The purpose of this is to draw transparent bitmaps, which is important for e.g. toggle buttons..PPSee also pixmap(), setText(), setAccel() and QPixmap::mask()..SH "void QButton::setState ( ToggleState t ) \fC[protected]\fR"This protected function sets the button state into state t but does \fInot\fR cause repainting..PPSee also setToggleType()..SH "void QButton::setText ( const QString & text ) \fC[virtual]\fR"Sets the button to display \fItext.\fR.PPIf the text contains an ampersand, QButton creates an automatic accelerator for it, such as Alt-c for "&Cancel"..PPSee also text(), setPixmap(), setAccel() and QPixmap::mask()..PPExamples:.(llayout/layout.cpp qmag/qmag.cpp xform/xform.cpp.)l.SH "void QButton::setToggleButton ( bool enable ) \fC[protected]\fR"Makes the button a toggle button if \fIenable\fR is TRUE, or a normal button if \fIenable\fR is FALSE..PPNote that this function is protected. It is called from subclasses to enable the toggle functionality. QCheckBox and QRadioButton are toggle buttons. QPushButton is initially not a toggle button, but QPushButton::setToggleButton() can be called to create toggle buttons..PPSee also isToggleButton()..SH "void QButton::setToggleType ( ToggleType type ) \fC[protected]\fR"Sets the type of toggling behavior. The default is \fISingleShot.\fR.PPSubclasses use this, and present it with a more comfortable interface..SH "QButton::ToggleState QButton::state() const"Returns the state of the button..PPSee also ToggleState, ToggleType and setState()..SH "void QButton::stateChanged ( int state ) \fC[signal]\fR"This signal is emitted whenever a toggle button changes status. \fIstate\fR is 2 if the button is on, 1 if it is in the" no change" state or 0 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()..SH "QString QButton::text () const"Returns the button text, or null string if the button has no text..PPSee also setText()..SH "void QButton::toggle () \fC[slot]\fR"if this is a toggle button, toggles it..SH "QButton::ToggleType QButton::toggleType() const"Returns the current toggle type..PPSee also setToggleType()..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()..SH "SEE ALSO".BR http://doc.trolltech.com/qbutton.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 (qbutton.3qt) and the Qtversion (2.3.8).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -