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

📄 qmenudata.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
📖 第 1 页 / 共 2 页
字号:
.PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel(), connectItem(), QAccel and qnamespace.h..SH "int QMenuData::insertItem ( const QIconSet & icon, const QPixmap & pixmap, int id=-1, int index=-1 )"Inserts a menu item with an icon and a pixmap. The icon will be displayed to the left of the pixmap in the item. Returns the menu item identifier..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel() and connectItem()..SH "int QMenuData::insertItem ( const QIconSet & icon, const QString & text, QPopupMenu * popup, int id=-1, int index=-1 )"Inserts a menu item with an icon, a text and a sub menu. The icon will be displayed to the left of the text in the item. Returns the menu item identifier..PPThe \fIpopup\fR must be deleted by the programmer or by its parent widget. It is not deleted when this menu item is removed or when the menu is deleted..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel() and connectItem()..SH "int QMenuData::insertItem ( const QIconSet & icon, const QString & text, const QObject * receiver, const char * member, int accel = 0, int id = -1, int index = -1 )"Inserts a menu item with an icon, a text, an accelerator key, an id and an optional index and connects it to an object/slot. The icon will be displayed to the left of the text in the item..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PPNote that accelerators only work for QPopupMenu items that live in a menu bar. For stand-alone popup menus, use an independent QAccel object..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel(), connectItem(), QAccel and qnamespace.h..SH "int QMenuData::insertItem ( const QIconSet & icon, const QString & text, int id=-1, int index=-1 )"Inserts a menu item with an icon and a text. The icon will be displayed to the left of the text in the item. Returns the menu item identifier..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel() and connectItem()..SH "int QMenuData::insertItem ( const QPixmap & pixmap, QPopupMenu * popup, int id=-1, int index=-1 )"Inserts a menu item with a pixmap and a sub menu. The icon will be displayed to the left of the pixmap in the item. Returns the menu item identifier..PPThe \fIpopup\fR must be deleted by the programmer or by its parent widget. It is not deleted when this menu item is removed or when the menu is deleted..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel() and connectItem()..SH "int QMenuData::insertItem ( const QPixmap & pixmap, const QObject * receiver, const char * member, int accel = 0, int id = -1, int index = -1 )"Inserts a menu item with a pixmap, an accelerator key, an id and an optional index and connects it to an object/slot..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PPNote that accelerators only work for QPopupMenu items that live in a menu bar. For stand-alone popup menus, use an independent QAccel object..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel(), connectItem(), QAccel and qnamespace.h..SH "int QMenuData::insertItem ( const QPixmap & pixmap, int id=-1, int index=-1 )"Inserts a menu item with a pixmap. Returns the menu item identifier..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel() and connectItem()..SH "int QMenuData::insertItem ( const QString & text, QPopupMenu * popup, int id=-1, int index=-1 )"Inserts a menu item with a text and a sub menu. Returns the menu item identifier..PPThe \fIpopup\fR must be deleted by the programmer or by its parent widget. It is not deleted when this menu item is removed or when the menu is deleted..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel() and connectItem()..PPExamples:.(lqtimage/qtimage.cpp grapher/grapher.cpp mainlyQt/editor.cpp layout/layout.cpp menu/menu.cpp progress/progress.cpp scrollview/scrollview.cpp.)l.SH "int QMenuData::insertItem ( const QString & text, const QObject * receiver, const char * member, int accel = 0, int id = -1, int index = -1 )"Inserts a menu item with a text, an accelerator key, an id and an optional index and connects it to an object/slot..PPExample:.PP.nf.br    QMenuBar   *mainMenu = new QMenuBar;.br    QPopupMenu *fileMenu = new QPopupMenu;.br    fileMenu->insertItem( "New",  myView, SLOT(newFile()), CTRL+Key_N );.br    fileMenu->insertItem( "Open", myView, SLOT(open()),    CTRL+Key_O );.br    mainMenu->insertItem( "File", fileMenu );.fi.PPIf you will need to translate accelerators, use QAccel::stringToKey() to calculate the accelerator key:.PP.nf.br    fileMenu->insertItem( tr("Open"), myView, SLOT(open()),.br                          QAccel::stringToKey( tr("Ctrl+O") ) );.fi.PPIn the example above, pressing CTRL+N or selecting "open" from the menu activates the myView->open() function..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PPNote that accelerators only work for QPopupMenu items that live in a menu bar. For stand-alone popup menus, use an independent QAccel object..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel(), connectItem(), QAccel and qnamespace.h..SH "int QMenuData::insertItem ( const QString & text, int id=-1, int index=-1 )"Inserts a menu item with a text. Returns the menu item identifier..PPThe menu item is assigned the identifier \fIid\fR or an automatically generated identifier if \fIid\fR is < 0. The generated identifiers (negative integers) are guaranteed to be unique within the entire application..PPThe \fIindex\fR specifies the position in the menu. The menu item is appended at the end of the list if \fIindex\fR is negative..PP\fBWarning:\fR Be careful when passing a literal 0 to insertItem(), as some C++ compilers choose the wrong overloaded function. Cast the 0 to what you mean, eg. \fC(QObject*)0\fR..PPSee also: removeItem(), changeItem(), setAccel() and connectItem()..SH "void QMenuData::insertSeparator ( int index=-1 )"Inserts a separator at position \fIindex.\fR The separator becomes the last menu item if \fIindex\fR is negative..PPIn a popup menu, a separator is rendered as a horizontal line. In a Motif menubar, a separator is spacing, so the rest of the items (just "Help", normally) are drawn right-justified. In a Windows menubar, all separator are ignored (to comply with the Windows style guide)..PPExamples:.(lgrapher/grapher.cpp menu/menu.cpp progress/progress.cpp scrollview/scrollview.cpp.)l.SH "bool QMenuData::isItemChecked ( int id ) const"Returns TRUE if the menu item has been checked, otherwise FALSE..PPSee also: setItemChecked()..PPExamples:.(lprogress/progress.cpp.)l.SH "bool QMenuData::isItemEnabled ( int id ) const"Returns TRUE if the item with identifier \fIid\fR is enabled or FALSE if it is disabled..PPSee also: setItemEnabled()..SH "void QMenuData::menuContentsChanged () \fC[virtual protected]\fR"Virtual function; notifies subclasses that one or more items have been inserted or removed..PPReimplemented in QMenuBar..SH "void QMenuData::menuDelPopup ( QPopupMenu * ) \fC[virtual protected]\fR"Virtual function; notifies subclasses that a popup menu item has been removed..SH "void QMenuData::menuInsPopup ( QPopupMenu * ) \fC[virtual protected]\fR"Virtual function; notifies subclasses that a popup menu item has been inserted..SH "void QMenuData::menuStateChanged () \fC[virtual protected]\fR"Virtual function; notifies subclasses that one or more items have changed state (enabled/disabled or checked/unchecked)..PPReimplemented in QMenuBar..SH "QPixmap * QMenuData::pixmap ( int id ) const"Returns the pixmap that has been set for menu item \fIid,\fR or 0 if no pixmap has been set..PPSee also: changeItem(), text() and iconSet()..SH "void QMenuData::removeItem ( int id )"Removes the menu item which has the identifier \fIid.\fR.PPSee also: removeItemAt() and clear()..SH "void QMenuData::removeItemAt ( int index )"Removes the menu item at position \fIindex.\fR.PPSee also: removeItem() and clear()..SH "void QMenuData::setAccel ( int key, int id )"Defines an accelerator key for the menu item \fIid.\fR.PPAn accelerator key consists of a key code and a combination of the modifiers \fCSHIFT, CTRL, ALT,\fR or \fCUNICODE_ACCEL\fR (OR'ed or added). The header file qnamespace.h contains a list of key codes..PPDefining an accelerator key generates a text which is added to the menu item, for instance, \fCCTRL\fR + \fCKey_O\fR generates "Ctrl+O". The text is formatted differently for different platforms..PPNote that accelerators only work for QPopupMenu items that live in a menu bar. For stand-alone popup menus, use an independent QAccel object..PPExample:.PP.nf.br    QMenuBar   *mainMenu = new QMenuBar;.br    QPopupMenu *fileMenu = new QPopupMenu;      // file sub menu.br    fileMenu->insertItem( "Open Document", 67 );// add "Open" item.br    fileMenu->setAccel( CTRL + Key_O, 67 );     // Control and O to open.br    fileMenu->insertItem( "Quit", 69 );         // add "Quit" item.br    fileMenu->setAccel( CTRL + ALT + Key_Delete, 69 );.br    mainMenu->insertItem( "File", fileMenu );   // add the file menu.fi.PPIf you will need to translate accelerators, use QAccel::stringToKey():.PP.nf.br    fileMenu->setAccel( QAccel::stringToKey(tr("Ctrl+O")), 67 );.fi.PPYou can also specify the accelerator in the insertItem() function..PPSee also: setAccel(), accel(), insertItem(), QAccel and qnamespace.h..SH "void QMenuData::setId ( int index, int id ) \fC[virtual]\fR"Sets the menu identifier of the item at \fIindex\fR to \fIid.\fR.PPIf index is out of range the operation is ignored..PPSee also: idAt()..SH "void QMenuData::setItemChecked ( int id, bool check )"Checks the menu item with id \fIid\fR if \fIcheck\fR is TRUE, or unchecks it if \fIcheck\fR is FALSE, and calls setCheckable( TRUE ) if necessary..PPSee also: isItemChecked()..PPExamples:.(lgrapher/grapher.cpp progress/progress.cpp scrollview/scrollview.cpp.)l.SH "void QMenuData::setItemEnabled ( int id, bool enable )"Enables the menu item with identifier \fIid\fR if \fIenable\fR is TRUE, or disables the item if \fIenable\fR is FALSE..PPSee also: isItemEnabled()..PPExamples:.(lmenu/menu.cpp progress/progress.cpp.)l.SH "void QMenuData::setWhatsThis ( int id, const QString & text )"Sets a Whats This help for a certain menu item..PPArguments:.TP\fIid\fR is the menu item id..TP\fItext\fR is the Whats This help text in QML format.PPSee also: whatsThis()..SH "QString QMenuData::text ( int id ) const"Returns the text that has been set for menu item \fIid,\fR or a null string if no text has been set..PPSee also: changeItem(), pixmap() and iconSet()..SH "void QMenuData::updateItem ( int ) \fC[virtual]\fR"Virtual function; notifies subclasses about an item that has been changed..PPReimplemented in QMenuBar..SH "QString QMenuData::whatsThis ( int id ) const"Returns the Whats This help text for the specified item \fIid\fR or QString::null if no text has been defined yet..PPSee also:  setWhatsThis()..SH "SEE ALSO".BR http://www.troll.no/qt/qmenudata.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS.  See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

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