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

📄 qpopupmenu.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 3 页
字号:
'\" t.TH QPopupMenu 3qt "9 December 2002" "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 NAMEQPopupMenu \- Popup menu widget.SH SYNOPSIS\fC#include <qpopupmenu.h>\fR.PPInherits QFrame and QMenuData..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQPopupMenu\fR ( QWidget * parent = 0, const char * name = 0 )".br.ti -1c.BI "\fB~QPopupMenu\fR ()".br.ti -1c.BI "void \fBpopup\fR ( const QPoint & pos, int indexAtPoint = -1 )".br.ti -1c.BI "virtual void \fBupdateItem\fR ( int id )".br.ti -1c.BI "virtual void \fBsetCheckable\fR ( bool )".br.ti -1c.BI "bool \fBisCheckable\fR () const".br.ti -1c.BI "int \fBexec\fR ()".br.ti -1c.BI "int \fBexec\fR ( const QPoint & pos, int indexAtPoint = 0 )".br.ti -1c.BI "virtual void \fBsetActiveItem\fR ( int i )".br.ti -1c.BI "int \fBidAt\fR ( int index ) const".br.ti -1c.BI "int \fBidAt\fR ( const QPoint & pos ) const".br.ti -1c.BI "int \fBinsertTearOffHandle\fR ( int id = -1, int index = -1 )".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBactivated\fR ( int id )".br.ti -1c.BI "void \fBhighlighted\fR ( int id )".br.ti -1c.BI "void \fBaboutToShow\fR ()".br.ti -1c.BI "void \fBaboutToHide\fR ()".br.in -1c.SS "Important Inherited Members".in +1c.ti -1c.BI "int \fBinsertItem\fR ( const QString & text, const QObject * receiver, const char * member, const QKeySequence & accel = 0, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QIconSet & icon, const QString & text, const QObject * receiver, const char * member, const QKeySequence & accel = 0, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QPixmap & pixmap, const QObject * receiver, const char * member, const QKeySequence & accel = 0, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QIconSet & icon, const QPixmap & pixmap, const QObject * receiver, const char * member, const QKeySequence & accel = 0, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QString & text, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QIconSet & icon, const QString & text, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QString & text, QPopupMenu * popup, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QIconSet & icon, const QString & text, QPopupMenu * popup, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QPixmap & pixmap, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QIconSet & icon, const QPixmap & pixmap, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QPixmap & pixmap, QPopupMenu * popup, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QIconSet & icon, const QPixmap & pixmap, QPopupMenu * popup, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( QWidget * widget, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( const QIconSet & icon, QCustomMenuItem * custom, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertItem\fR ( QCustomMenuItem * custom, int id = -1, int index = -1 )".br.ti -1c.BI "int \fBinsertSeparator\fR ( int index = -1 )".br.ti -1c.BI "void \fBremoveItem\fR ( int id )".br.ti -1c.BI "void \fBremoveItemAt\fR ( int index )".br.ti -1c.BI "void \fBclear\fR ()".br.ti -1c.BI "QKeySequence \fBaccel\fR ( int id ) const".br.ti -1c.BI "void \fBsetAccel\fR ( const QKeySequence & key, int id )".br.ti -1c.BI "QIconSet * \fBiconSet\fR ( int id ) const".br.ti -1c.BI "QString \fBtext\fR ( int id ) const".br.ti -1c.BI "QPixmap * \fBpixmap\fR ( int id ) const".br.ti -1c.BI "void \fBsetWhatsThis\fR ( int id, const QString & text )".br.ti -1c.BI "QString \fBwhatsThis\fR ( int id ) const".br.ti -1c.BI "void \fBchangeItem\fR ( int id, const QString & text )".br.ti -1c.BI "void \fBchangeItem\fR ( int id, const QPixmap & pixmap )".br.ti -1c.BI "void \fBchangeItem\fR ( int id, const QIconSet & icon, const QString & text )".br.ti -1c.BI "void \fBchangeItem\fR ( int id, const QIconSet & icon, const QPixmap & pixmap )".br.ti -1c.BI "bool \fBisItemEnabled\fR ( int id ) const".br.ti -1c.BI "void \fBsetItemEnabled\fR ( int id, bool enable )".br.ti -1c.BI "bool \fBisItemChecked\fR ( int id ) const".br.ti -1c.BI "void \fBsetItemChecked\fR ( int id, bool check )".br.ti -1c.BI "bool \fBisItemVisible\fR ( int id ) const".br.ti -1c.BI "void \fBsetItemVisible\fR ( int id, bool visible )".br.ti -1c.BI "bool \fBconnectItem\fR ( int id, const QObject * receiver, const char * member )".br.ti -1c.BI "bool \fBdisconnectItem\fR ( int id, const QObject * receiver, const char * member )".br.ti -1c.BI "bool \fBsetItemParameter\fR ( int id, int param )".br.ti -1c.BI "int \fBitemParameter\fR ( int id ) const".br.in -1c.SS "Properties".in +1c.ti -1c.BI "bool \fBcheckable\fR - whether the display of check marks on menu items is enabled".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "int \fBitemHeight\fR ( int row ) const".br.ti -1c.BI "int \fBitemHeight\fR ( QMenuItem * mi ) const".br.ti -1c.BI "void \fBdrawItem\fR ( QPainter * p, int tab_, QMenuItem * mi, bool act, int x, int y, int w, int h )".br.ti -1c.BI "virtual void \fBdrawContents\fR ( QPainter * p )".br.ti -1c.BI "int \fBcolumns\fR () const".br.in -1c.SH DESCRIPTIONThe QPopupMenu class provides a popup menu widget..PPA popup menu widget is a selection menu. It can be either a pull-down menu in a menu bar or a standalone context (popup) menu. Pull-down menus are shown by the menu bar when the user clicks on the respective item or presses the specified shortcut key. Use QMenuBar::insertItem() to insert a popup menu into a menu bar. Show a context menu either asynchronously with popup() or synchronously with exec()..PPTechnically, a popup menu consists of a list of menu items. You add items with insertItem(). An item is either a string, a pixmap or a custom item that provides its own drawing function (see QCustomMenuItem). In addition, items can have an optional icon drawn on the very left side and an accelerator key such as" Ctrl+X"..PPThere are three kinds of menu items: separators, menu items that perform an action and menu items that show a submenu. Separators are inserted with insertSeparator(). For submenus, you pass a pointer to a QPopupMenu in your call to insertItem(). All other items are considered action items..PPWhen inserting action items you usually specify a receiver and a slot. The receiver will be notifed whenever the item is selected. In addition, QPopupMenu provides two signals, activated() and highlighted(), which signal the identifier of the respective menu item. It is sometimes practical to connect several items to one slot. To distinguish between them, specify a slot that takes an integer argument and use setItemParameter() to associate a unique value with each item..PPYou clear a popup menu with clear() and remove single items with removeItem() or removeItemAt()..PPA popup menu can display check marks for certain items when enabled with setCheckable(TRUE). You check or uncheck items with setItemChecked()..PPItems are either enabled or disabled. You toggle their state with setItemEnabled(). Just before a popup menu becomes visible, it emits the aboutToShow() signal. You can use this signal to set the correct enabled/disabled states of all menu items before the user sees it. The corresponding aboutToHide() signal is emitted when the menu hides again..PPYou can provide What's This? help for single menu items with setWhatsThis(). See QWhatsThis for general information about this kind of lightweight online help..PPFor ultimate flexibility, you can also add entire widgets as items into a popup menu (for example, a color selector)..PPA QPopupMenu can also provide a tear-off menu. A tear-off menu is a top-level window that contains a copy of the menu. This makes it possible for the user to "tear off" frequently used menus and position them in a convenient place on the screen. If you want that functionality for a certain menu, insert a tear-off handle with insertTearOffHandle(). When using tear-off menus, bear in mind that the concept isn't typically used on Microsoft Windows so users may not be familiar with it. Consider using a QToolBar instead. Tear-off menus cannot contain custom widgets; if the original menu contains a custom widget item, this item is omitted..PPmenu/menu.cpp is an example of QMenuBar and QPopupMenu use..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QMenuBar, GUI Design Handbook: Menu, Drop-Down and Pop-Up, Main Window and Related Classes, and Basic Widgets..SH MEMBER FUNCTION DOCUMENTATION.SH "QPopupMenu::QPopupMenu ( QWidget * parent = 0, const char * name = 0 )"Constructs a popup menu called \fIname\fR with parent \fIparent\fR..PPAlthough a popup menu is always a top-level widget, if a parent is passed the popup menu will be deleted when that parent is destroyed (as with any other QObject)..SH "QPopupMenu::~QPopupMenu ()"Destroys the popup menu..SH "void QPopupMenu::aboutToHide ()\fC [signal]\fR"This signal is emitted just before the popup menu is hidden after it has been displayed..PP\fBWarning:\fR Do not open a widget in a slot connected to this signal..PPSee also aboutToShow(), setItemEnabled(), setItemChecked(), insertItem(), and removeItem()..SH "void QPopupMenu::aboutToShow ()\fC [signal]\fR"This signal is emitted just before the popup menu is displayed. You can connect it to any slot that sets up the menu contents (e.g. to ensure that the right items are enabled)..PPSee also aboutToHide(), setItemEnabled(), setItemChecked(), insertItem(), and removeItem()..PPExample: mdi/application.cpp..SH "QKeySequence QMenuData::accel ( int id ) const"

⌨️ 快捷键说明

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