?? qpushbutton.3qt
字號:
'\" t.TH QPushButton 3qt "21 January 2005" "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 NAMEQPushButton \- Command button.SH SYNOPSIS\fC#include <qpushbutton.h>\fR.PPInherits QButton..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQPushButton\fR ( QWidget * parent, const char * name = 0 )".br.ti -1c.BI "\fBQPushButton\fR ( const QString & text, QWidget * parent, const char * name = 0 )".br.ti -1c.BI "\fBQPushButton\fR ( const QIconSet & icon, const QString & text, QWidget * parent, const char * name = 0 )".br.ti -1c.BI "\fB~QPushButton\fR ()".br.ti -1c.BI "void \fBsetToggleButton\fR ( bool )".br.ti -1c.BI "bool \fBautoDefault\fR () const".br.ti -1c.BI "virtual void \fBsetAutoDefault\fR ( bool autoDef )".br.ti -1c.BI "bool \fBisDefault\fR () const".br.ti -1c.BI "virtual void \fBsetDefault\fR ( bool def )".br.ti -1c.BI "virtual void setIsMenuButton ( bool enable ) \fI(obsolete)\fR".br.ti -1c.BI "bool isMenuButton () const \fI(obsolete)\fR".br.ti -1c.BI "void \fBsetPopup\fR ( QPopupMenu * popup )".br.ti -1c.BI "QPopupMenu * \fBpopup\fR () const".br.ti -1c.BI "void \fBsetIconSet\fR ( const QIconSet & )".br.ti -1c.BI "QIconSet * \fBiconSet\fR () const".br.ti -1c.BI "void \fBsetFlat\fR ( bool )".br.ti -1c.BI "bool \fBisFlat\fR () const".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBsetOn\fR ( bool )".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 \fBautoDefault\fR - whether the push button is the auto default button".br.ti -1c.BI "bool \fBautoMask\fR - whether the button is automatically masked \fI(read " "only" ")\fR".br.ti -1c.BI "bool \fBdefault\fR - whether the push button is the default button".br.ti -1c.BI "bool \fBflat\fR - whether the border is disabled".br.ti -1c.BI "QIconSet \fBiconSet\fR - the icon set on the push button".br.ti -1c.BI "bool menuButton - whether the push button has a menu button on it \fI(read " "only" ")\fR \fI(obsolete)\fR".br.ti -1c.BI "bool \fBon\fR - whether the push button is toggled".br.ti -1c.BI "bool \fBtoggleButton\fR - whether the button is a toggle button".br.in -1c.SH DESCRIPTIONThe QPushButton widget provides a command button..PPThe push button, or command button, is perhaps the most commonly used widget in any graphical user interface. Push (click) a button to command the computer to perform some action, or to answer a question. Typical buttons are OK, Apply, Cancel, Close, Yes, No and Help..PPA command button is rectangular and typically displays a text label describing its action. An underlined character in the label (signified by preceding it with an ampersand in the text) indicates an accelerator key, e.g..PP.nf.br QPushButton *pb = new QPushButton( "&Download", this );.br.fiIn this example the accelerator is \fIAlt+D\fR, and the label text will be displayed as \fB<u>D</u>ownload\fR..PPPush buttons can display a textual label or a pixmap, and optionally a small icon. These can be set using the constructors and changed later using setText(), setPixmap() and setIconSet(). If the button is disabled the appearance of the text or pixmap and iconset will be manipulated with respect to the GUI style to make the button look "disabled"..PPA push button emits the signal clicked() when it is activated by the mouse, the Spacebar or by a keyboard accelerator. Connect to this signal to perform the button's action. Push buttons also provide less commonly used signals, for example, pressed() and released()..PPCommand buttons in dialogs are by default auto-default buttons, i.e. they become the default push button automatically when they receive the keyboard input focus. A default button is a push button that is activated when the user presses the Enter or Return key in a dialog. You can change this with setAutoDefault(). Note that auto-default buttons reserve a little extra space which is necessary to draw a default-button indicator. If you do not want this space around your buttons, call setAutoDefault(FALSE)..PPBeing so central, the button widget has grown to accommodate a great many variations in the past decade. The Microsoft style guide now shows about ten different states of Windows push buttons and the text implies that there are dozens more when all the combinations of features are taken into consideration..PPThe most important modes or states are:.TPAvailable or not (grayed out, disabled)..TPStandard push button, toggling push button or menu button..TPOn or off (only for toggling push buttons)..TPDefault or normal. The default button in a dialog can generally be "clicked" using the Enter or Return key..TPAuto-repeat or not..TPPressed down or not..PPAs a general rule, use a push button when the application or dialog window performs an action when the user clicks on it (such as Apply, Cancel, Close and Help) \fIand\fR when the widget is supposed to have a wide, rectangular shape with a text label. Small, typically square buttons that change the state of the window rather than performing an action (such as the buttons in the top-right corner of the QFileDialog) are not command buttons, but tool buttons. Qt provides a special class (QToolButton) for these buttons..PPIf you need toggle behavior (see setToggleButton()) or a button that auto-repeats the activation signal when being pushed down like the arrows in a scroll bar (see setAutoRepeat()), a command button is probably not what you want. When in doubt, use a tool button..PPA variation of a command button is a menu button. These provide not just one command, but several, since when they are clicked they pop up a menu of options. Use the method setPopup() to associate a popup menu with a push button..PPOther classes of buttons are option buttons (see QRadioButton) and check boxes (see QCheckBox)..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPIn Qt, the QButton abstract base class provides most of the modes and other API, and QPushButton provides GUI logic. See QButton for more information about the API..PPSee also QToolButton, QRadioButton, QCheckBox, GUI Design Handbook: Push Button, and Basic Widgets..SH MEMBER FUNCTION DOCUMENTATION.SH "QPushButton::QPushButton ( QWidget * parent, const char * name = 0 )"Constructs a push button with no text..PPThe \fIparent\fR and \fIname\fR arguments are sent on to the QWidget constructor..SH "QPushButton::QPushButton ( const QString & text, QWidget * parent, const char * name = 0 )"Constructs a push button called \fIname\fR with the parent \fIparent\fR and the text \fItext\fR..SH "QPushButton::QPushButton ( const QIconSet & icon, const QString & text, QWidget * parent, const char * name = 0 )"Constructs a push button with an \fIicon\fR and a \fItext\fR..PPNote that you can also pass a QPixmap object as an icon (thanks to the implicit type conversion provided by C++)..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -