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

📄 qaction.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 2 页
字号:
.PPThe \fItext\fR and \fIaccel\fR will be used for tool tips and status tips unless you provide specific text for these using setToolTip() and setStatusTip()..SH "QAction::QAction ( const QString & text, const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0, bool toggle = FALSE )"This constructor results in an iconless action with the description \fItext\fR, the menu text \fImenuText\fR and the keyboard accelerator \fIaccel\fR. Its parent is \fIparent\fR and its name \fIname\fR. If \fItoggle\fR is TRUE the action will be a toggle action otherwise it will be a command action..PPThe action automatically becomes a member of \fIparent\fR if \fIparent\fR is a QActionGroup..PPThe \fIparent\fR should be a widget for accelerators and status tips to work..PPThe \fItext\fR and \fIaccel\fR will be used for tool tips and status tips unless you provide specific text for these using setToolTip() and setStatusTip()..SH "QAction::~QAction ()"Destroys the object and frees allocated resources..SH "QKeySequence QAction::accel () const"Returns the action's accelerator key. See the "accel" property for details..SH "void QAction::activated ()\fC [signal]\fR"This signal is emitted when an action is activated by the user, i.e. when the user clicks a menu option or a toolbar button or presses an action's accelerator key combination..PPConnect to this signal for command actions. Connect to the toggled() signal for toggle actions..PPExample: action/application.cpp..SH "bool QAction::addTo ( QWidget * w )\fC [virtual]\fR"Adds this action to widget \fIw\fR..PPCurrently actions may be added to QToolBar and QPopupMenu widgets..PPAn action added to a tool bar is automatically displayed as a tool button; an action added to a pop up menu appears as a menu option..PPaddTo() returns TRUE if the action was added successfully and FALSE otherwise. (If \fIw\fR is not a QToolBar or QPopupMenu the action will not be added and FALSE will be returned.).PPSee also removeFrom()..PPExamples:.)l action/application.cpp, action/toggleaction/toggleaction.cpp and textedit/textedit.cpp..PPReimplemented in QActionGroup..SH "void QAction::addedTo ( QWidget * actionWidget, QWidget * container )\fC [virtual protected]\fR"This function is called from the addTo() function when it created a widget (\fIactionWidget\fR) for the action in the \fIcontainer\fR..SH "void QAction::addedTo ( int index, QPopupMenu * menu )\fC [virtual protected]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPThis function is called from the addTo() function when it created a menu item at the index \fIindex\fR in the popup menu \fImenu\fR..SH "QIconSet QAction::iconSet () const"Returns the action's icon. See the "iconSet" property for details..SH "bool QAction::isEnabled () const"Returns TRUE if the action is enabled; otherwise returns FALSE. See the "enabled" property for details..SH "bool QAction::isOn () const"Returns TRUE if a toggle action is on; otherwise returns FALSE. See the "on" property for details..SH "bool QAction::isToggleAction () const"Returns TRUE if the action is a toggle action; otherwise returns FALSE. See the "toggleAction" property for details..SH "QString QAction::menuText () const"Returns the action's menu text. See the "menuText" property for details..SH "bool QAction::removeFrom ( QWidget * w )\fC [virtual]\fR"Removes the action from widget \fIw\fR..PPReturns TRUE if the action was removed successfully, FALSE otherwise..PPSee also addTo()..SH "void QAction::setAccel ( const QKeySequence & key )\fC [virtual]\fR"Sets the action's accelerator key to \fIkey\fR. See the "accel" property for details..SH "void QAction::setEnabled ( bool )\fC [virtual slot]\fR"Sets whether the action is enabled. See the "enabled" property for details..SH "void QAction::setIconSet ( const QIconSet & )\fC [virtual]\fR"Sets the action's icon. See the "iconSet" property for details..SH "void QAction::setMenuText ( const QString & )\fC [virtual]\fR"Sets the action's menu text. See the "menuText" property for details..SH "void QAction::setOn ( bool )\fC [virtual slot]\fR"Sets whether a toggle action is on. See the "on" property for details..SH "void QAction::setStatusTip ( const QString & )\fC [virtual]\fR"Sets the action's status tip. See the "statusTip" property for details..SH "void QAction::setText ( const QString & )\fC [virtual]\fR"Sets the action's descriptive text. See the "text" property for details..SH "void QAction::setToggleAction ( bool )\fC [virtual]\fR"Sets whether the action is a toggle action. See the "toggleAction" property for details..SH "void QAction::setToolTip ( const QString & )\fC [virtual]\fR"Sets the action's tool tip. See the "toolTip" property for details..SH "void QAction::setWhatsThis ( const QString & )\fC [virtual]\fR"Sets the action's "What's This ?" help text. See the "whatsThis" property for details..SH "QString QAction::statusTip () const"Returns the action's status tip. See the "statusTip" property for details..SH "QString QAction::text () const"Returns the action's descriptive text. See the "text" property for details..SH "void QAction::toggle ()\fC [slot]\fR"Toggles the state of a toggle action..PPSee also on, toggled() and toggleAction..SH "void QAction::toggled ( bool )\fC [signal]\fR"This signal is emitted when a toggle action changes state; command actions and QActionGroups don't emit toggled()..PPThe argument denotes the new state; i.e. TRUE if the toggle action was switched on and FALSE if it was switched off..PPTo trigger a user command depending on whether a toggle action has been switched on or off connect it to a slot that takes a bool to indicate the state, e.g..PP.nf.br        QMainWindow * window = new QMainWindow;.fi.PP.nf.br        QAction * labelonoffaction = new QAction( window, "labelonoff", TRUE );.fi.PP.nf.br        QObject::connect( labelonoffaction, SIGNAL( toggled( bool ) ),.br                          window, SLOT( setUsesTextLabel( bool ) ) );.fi.PPSee also activated(), toggleAction and on..PPExample: action/toggleaction/toggleaction.cpp..SH "QString QAction::toolTip () const"Returns the action's tool tip. See the "toolTip" property for details..SH "QString QAction::whatsThis () const"Returns the action's "What's This ?" help text. See the "whatsThis" property for details..SS "Property Documentation".SH "QKeySequence accel"This property holds the action's accelerator key..PPThe keycodes can be found in Qt::Key and Qt::Modifier..PPSet this property's value with setAccel() and get this property's value with accel()..SH "bool enabled"This property holds whether the action is enabled..PPDisabled actions can't be chosen by the user. They don't disappear from the menu/tool bar but are displayed in a way which indicates that they are unavailable, e.g. they might be displayed greyed out..PPWhat's this? help on disabled actions is still available provided the QAction::whatsThis property is set..PPSet this property's value with setEnabled() and get this property's value with isEnabled()..SH "QIconSet iconSet"This property holds the action's icon..PPThe icon is used as tool button icon and in the menu to the left of the menu text..PP(See the action/toggleaction/toggleaction.cpp example.).PPSet this property's value with setIconSet() and get this property's value with iconSet()..SH "QString menuText"This property holds the action's menu text..PPIf the action is added to a menu the menu option will consist of the icon (if there is one), the menu text and the accelerator (if there is one). If the menu text is not explicitly set in the constructor or using setMenuText() the action's description text will be used as the menu text..PPSee also text..PPSet this property's value with setMenuText() and get this property's value with menuText()..SH "bool on"This property holds whether a toggle action is on..PPThis property is always on for command actions and QActionGroups. setOn() has no effect on them..PPSee also toggleAction..PPSet this property's value with setOn() and get this property's value with isOn()..SH "QString statusTip"This property holds the action's status tip..PPThe statusTip is displayed on all status bars that the toplevel widget parenting this action provides..PPIf no status tip is defined, the action uses the tool tip text..PPSee also statusTip and toolTip..PPSet this property's value with setStatusTip() and get this property's value with statusTip()..SH "QString text"This property holds the action's descriptive text..PPIf QMainWindow::usesTextLabel is TRUE, the text appears as a label in the relevant toolbutton. It also serves as the default text in menus and tips if these have not been specifically defined..PPSee also menuText, toolTip and statusTip..PPSet this property's value with setText() and get this property's value with text()..SH "bool toggleAction"This property holds whether the action is a toggle action..PPA toggle action is one which has an on/off state. For example a Bold toolbar button is either on or off. An action which is not a toggle action is a command action; a command action is simply executed. For example a file open toolbar button would invoke a file open dialog..PPFor exclusive toggling, add toggle actions to a QActionGroup with the QActionGroup::exclusive property set to TRUE..PPSet this property's value with setToggleAction() and get this property's value with isToggleAction()..SH "QString toolTip"This property holds the action's tool tip..PPThis text is used for the tool tip. If no status tip has been set the tool tip will be used for the status tip..PPIf no tool tip is specified the action's text and accelerator description are used as a default tool tip..PPSee also statusTip and accel..PPSet this property's value with setToolTip() and get this property's value with toolTip()..SH "QString whatsThis"This property holds the action's "What's This ?" help text..PPThe whats this text is used to provide a brief description of the action. The text may contain rich text (i.e. HTML tags -- see QStyleSheet for the list of supported tags)..PPSee also QWhatsThis..PPSet this property's value with setWhatsThis() and get this property's value with whatsThis()..SH "SEE ALSO".BR http://doc.trolltech.com/qaction.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 (qaction.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

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