1QMenuData(3qt)                                                  QMenuData(3qt)
2
3
4

NAME

6       QMenuData - Base class for QMenuBar and QPopupMenu
7

SYNOPSIS

9       #include <qmenudata.h>
10
11       Inherited by QMenuBar and QPopupMenu.
12
13   Public Members
14       QMenuData ()
15       virtual ~QMenuData ()
16       uint count () const
17       int insertItem ( const QString & text, const QObject * receiver, const
18           char * member, const QKeySequence & accel = 0, int id = -1, int
19           index = -1 )
20       int insertItem ( const QIconSet & icon, const QString & text, const
21           QObject * receiver, const char * member, const QKeySequence & accel
22           = 0, int id = -1, int index = -1 )
23       int insertItem ( const QPixmap & pixmap, const QObject * receiver,
24           const char * member, const QKeySequence & accel = 0, int id = -1,
25           int index = -1 )
26       int insertItem ( const QIconSet & icon, const QPixmap & pixmap, const
27           QObject * receiver, const char * member, const QKeySequence & accel
28           = 0, int id = -1, int index = -1 )
29       int insertItem ( const QString & text, int id = -1, int index = -1 )
30       int insertItem ( const QIconSet & icon, const QString & text, int id =
31           -1, int index = -1 )
32       int insertItem ( const QString & text, QPopupMenu * popup, int id = -1,
33           int index = -1 )
34       int insertItem ( const QIconSet & icon, const QString & text,
35           QPopupMenu * popup, int id = -1, int index = -1 )
36       int insertItem ( const QPixmap & pixmap, int id = -1, int index = -1 )
37       int insertItem ( const QIconSet & icon, const QPixmap & pixmap, int id
38           = -1, int index = -1 )
39       int insertItem ( const QPixmap & pixmap, QPopupMenu * popup, int id =
40           -1, int index = -1 )
41       int insertItem ( const QIconSet & icon, const QPixmap & pixmap,
42           QPopupMenu * popup, int id = -1, int index = -1 )
43       int insertItem ( QWidget * widget, int id = -1, int index = -1 )
44       int insertItem ( const QIconSet & icon, QCustomMenuItem * custom, int
45           id = -1, int index = -1 )
46       int insertItem ( QCustomMenuItem * custom, int id = -1, int index = -1
47           )
48       int insertSeparator ( int index = -1 )
49       void removeItem ( int id )
50       void removeItemAt ( int index )
51       void clear ()
52       QKeySequence accel ( int id ) const
53       void setAccel ( const QKeySequence & key, int id )
54       QIconSet * iconSet ( int id ) const
55       QString text ( int id ) const
56       QPixmap * pixmap ( int id ) const
57       void setWhatsThis ( int id, const QString & text )
58       QString whatsThis ( int id ) const
59       void changeItem ( int id, const QString & text )
60       void changeItem ( int id, const QPixmap & pixmap )
61       void changeItem ( int id, const QIconSet & icon, const QString & text )
62       void changeItem ( int id, const QIconSet & icon, const QPixmap & pixmap
63           )
64       void changeItem ( const QString & text, int id )  (obsolete)
65       void changeItem ( const QPixmap & pixmap, int id )  (obsolete)
66       void changeItem ( const QIconSet & icon, const QString & text, int id )
67           (obsolete)
68       bool isItemActive ( int id ) const
69       bool isItemEnabled ( int id ) const
70       void setItemEnabled ( int id, bool enable )
71       bool isItemChecked ( int id ) const
72       void setItemChecked ( int id, bool check )
73       bool isItemVisible ( int id ) const
74       void setItemVisible ( int id, bool visible )
75       virtual void updateItem ( int id )
76       int indexOf ( int id ) const
77       int idAt ( int index ) const
78       virtual void setId ( int index, int id )
79       bool connectItem ( int id, const QObject * receiver, const char *
80           member )
81       bool disconnectItem ( int id, const QObject * receiver, const char *
82           member )
83       bool setItemParameter ( int id, int param )
84       int itemParameter ( int id ) const
85       QMenuItem * findItem ( int id ) const
86       QMenuItem * findItem ( int id, QMenuData ** parent ) const
87       virtual void activateItemAt ( int index )
88
89   Protected Members
90       virtual void menuContentsChanged ()
91       virtual void menuStateChanged ()
92       virtual void menuInsPopup ( QPopupMenu * )
93       virtual void menuDelPopup ( QPopupMenu * )
94

DESCRIPTION

96       The QMenuData class is a base class for QMenuBar and QPopupMenu.
97
98       QMenuData has an internal list of menu items. A menu item can have a
99       text(), an accelerator, a pixmap(), an iconSet(), a whatsThis() text
100       and a popup menu (unless it is a separator). Menu items may optionally
101       be checked (except for separators).
102
103       The menu item sends out an activated() signal when it is chosen and a
104       highlighted() signal when it receives the user input focus.
105
106       Menu items are assigned the menu identifier id that is passed in
107       insertItem() or an automatically generated identifier if id is < 0 (the
108       default). The generated identifiers (negative integers) are guaranteed
109       to be unique within the entire application. The identifier is used to
110       access the menu item in other functions.
111
112       Menu items can be removed with removeItem() and removeItemAt(), or
113       changed with changeItem(). All menu items can be removed with clear().
114       Accelerators can be changed or set with setAccel(). Checkable items can
115       be checked or unchecked with setItemChecked(). Items can be enabled or
116       disabled using setItemEnabled() and connected and disconnected with
117       connectItem() and disconnectItem() respectively. By default, newly
118       created menu items are visible. They can be hidden (and shown again)
119       with setItemVisible().
120
121       Menu items are stored in a list. Use findItem() to find an item by its
122       list position or by its menu identifier. (See also indexOf() and
123       idAt().)
124
125       See also QAccel, QPopupMenu, QAction, and Miscellaneous Classes.
126

MEMBER FUNCTION DOCUMENTATION

QMenuData::QMenuData ()

129       Constructs an empty menu data list.
130

QMenuData::~QMenuData () [virtual]

132       Removes all menu items and disconnects any signals that have been
133       connected.
134

QKeySequence QMenuData::accel ( int id ) const

136       Returns the accelerator key that has been defined for the menu item id,
137       or 0 if it has no accelerator key or if there is no such menu item.
138
139       See also setAccel(), QAccel, and qnamespace.h.
140

void QMenuData::activateItemAt ( int index ) [virtual]

142       Activates the menu item at position index.
143
144       If the index is invalid (for example, -1), the object itself is
145       deactivated.
146

void QMenuData::changeItem ( int id, const QString & text )

148       Changes the text of the menu item id to text. If the item has an icon,
149       the icon remains unchanged.
150
151       See also text().
152

void QMenuData::changeItem ( int id, const QPixmap & pixmap )

154       This is an overloaded member function, provided for convenience. It
155       behaves essentially like the above function.
156
157       Changes the pixmap of the menu item id to the pixmap pixmap. If the
158       item has an icon, the icon is unchanged.
159
160       See also pixmap().
161

void QMenuData::changeItem ( int id, const QIconSet & icon, const QString &

163       text )
164       This is an overloaded member function, provided for convenience. It
165       behaves essentially like the above function.
166
167       Changes the iconset and text of the menu item id to the icon and text
168       respectively.
169
170       See also pixmap().
171

void QMenuData::changeItem ( int id, const QIconSet & icon, const QPixmap &

173       pixmap )
174       This is an overloaded member function, provided for convenience. It
175       behaves essentially like the above function.
176
177       Changes the iconset and pixmap of the menu item id to icon and pixmap
178       respectively.
179
180       See also pixmap().
181

void QMenuData::changeItem ( const QString & text, int id )

183       This function is obsolete. It is provided to keep old source working.
184       We strongly advise against using it in new code.
185
186       Changes the text of the menu item id. If the item has an icon, the icon
187       remains unchanged.
188
189       See also text().
190

void QMenuData::changeItem ( const QPixmap & pixmap, int id )

192       This function is obsolete. It is provided to keep old source working.
193       We strongly advise against using it in new code.
194
195       Changes the pixmap of the menu item id. If the item has an icon, the
196       icon remains unchanged.
197
198       See also pixmap().
199

void QMenuData::changeItem ( const QIconSet & icon, const QString & text, int

201       id )
202       This function is obsolete. It is provided to keep old source working.
203       We strongly advise against using it in new code.
204
205       Changes the icon and text of the menu item id.
206
207       See also pixmap().
208

void QMenuData::clear ()

210       Removes all menu items.
211
212       See also removeItem() and removeItemAt().
213
214       Examples:
215

bool QMenuData::connectItem ( int id, const QObject * receiver, const char *

217       member )
218       Connects the menu item with identifier id to receiver's member slot or
219       signal.
220
221       The receiver's slot (or signal) is activated when the menu item is
222       activated.
223
224       See also disconnectItem() and setItemParameter().
225
226       Example: menu/menu.cpp.
227

uint QMenuData::count () const

229       Returns the number of items in the menu.
230

bool QMenuData::disconnectItem ( int id, const QObject * receiver, const char

232       * member )
233       Disconnects the receiver's member from the menu item with identifier
234       id.
235
236       All connections are removed when the menu data object is destroyed.
237
238       See also connectItem() and setItemParameter().
239

QMenuItem * QMenuData::findItem ( int id ) const

241       Returns the menu item with identifier id, or 0 if there is no item with
242       this identifier.
243
244       Note that QMenuItem is an internal class, and that you should not need
245       to call this function. Use the higher level functions like text(),
246       pixmap() and changeItem() to get and modify menu item attributes
247       instead.
248
249       See also indexOf().
250
251       Example: chart/chartform.cpp.
252

QMenuItem * QMenuData::findItem ( int id, QMenuData ** parent ) const

254       This is an overloaded member function, provided for convenience. It
255       behaves essentially like the above function.
256
257       Returns the menu item with identifier id, or 0 if there is no item with
258       this identifier. Changes *parent to point to the parent of the return
259       value.
260
261       Note that QMenuItem is an internal class, and that you should not need
262       to call this function. Use the higher level functions like text(),
263       pixmap() and changeItem() to get and modify menu item attributes
264       instead.
265
266       See also indexOf().
267

QIconSet * QMenuData::iconSet ( int id ) const

269       Returns the icon set that has been set for menu item id, or 0 if no
270       icon set has been set.
271
272       See also changeItem(), text(), and pixmap().
273

int QMenuData::idAt ( int index ) const

275       Returns the identifier of the menu item at position index in the
276       internal list, or -1 if index is out of range.
277
278       See also setId() and indexOf().
279

int QMenuData::indexOf ( int id ) const

281       Returns the index of the menu item with identifier id, or -1 if there
282       is no item with this identifier.
283
284       See also idAt() and findItem().
285
286       Example: scrollview/scrollview.cpp.
287

int QMenuData::insertItem ( const QString & text, const QObject * receiver,

289       const char * member, const QKeySequence & accel = 0, int id = -1, int
290       index = -1 )
291       The family of insertItem() functions inserts menu items into a popup
292       menu or a menu bar.
293
294       A menu item is usually either a text string or a pixmap, both with an
295       optional icon or keyboard accelerator. For special cases it is also
296       possible to insert custom items (see QCustomMenuItem) or even widgets
297       into popup menus.
298
299       Some insertItem() members take a popup menu as an additional argument.
300       Use this to insert submenus into existing menus or pulldown menus into
301       a menu bar.
302
303       The number of insert functions may look confusing, but they are
304       actually quite simple to use.
305
306       This default version inserts a menu item with the text text, the
307       accelerator key accel, an id and an optional index and connects it to
308       the slot member in the object receiver.
309
310       Example:
311
312               QMenuBar   *mainMenu = new QMenuBar;
313               QPopupMenu *fileMenu = new QPopupMenu;
314               fileMenu->insertItem( "New",  myView, SLOT(newFile()), CTRL+Key_N );
315               fileMenu->insertItem( "Open", myView, SLOT(open()),    CTRL+Key_O );
316               mainMenu->insertItem( "File", fileMenu );
317
318       Not all insert functions take an object/slot parameter or an
319       accelerator key. Use connectItem() and setAccel() on those items.
320
321       If you need to translate accelerators, use tr() with the text and
322       accelerator. (For translations use a string key sequence.):
323
324               fileMenu->insertItem( tr("Open"), myView, SLOT(open()),
325                                     tr("Ctrl+O") );
326
327       In the example above, pressing Ctrl+O or selecting "Open" from the menu
328       activates the myView->open() function.
329
330       Some insert functions take a QIconSet parameter to specify the little
331       menu item icon. Note that you can always pass a QPixmap object instead.
332
333       The id specifies the identification number associated with the menu
334       item. Note that only positive values are valid, as a negative value
335       will make Qt select a unique id for the item.
336
337       The index specifies the position in the menu. The menu item is appended
338       at the end of the list if index is negative.
339
340       Note that keyboard accelerators in Qt are not application-global,
341       instead they are bound to a certain top-level window. For example,
342       accelerators in QPopupMenu items only work for menus that are
343       associated with a certain window. This is true for popup menus that
344       live in a menu bar since their accelerators will then be installed in
345       the menu bar itself. This also applies to stand-alone popup menus that
346       have a top-level widget in their parentWidget() chain. The menu will
347       then install its accelerator object on that top-level widget. For all
348       other cases use an independent QAccel object.
349
350       Warning: Be careful when passing a literal 0 to insertItem() because
351       some C++ compilers choose the wrong overloaded function. Cast the 0 to
352       what you mean, e.g. (QObject*)0.
353
354       Warning: On Mac OS X, items that connect to a slot that are inserted
355       into a menubar will not function as we use the native menubar that
356       knows nothing about signals or slots. Instead insert the items into a
357       popup menu and insert the popup menu into the menubar. This may be
358       fixed in a future Qt version.
359
360       Returns the allocated menu identifier number (id if id >= 0).
361
362       See also removeItem(), changeItem(), setAccel(), connectItem(), QAccel,
363       and qnamespace.h.
364
365       Examples:
366

int QMenuData::insertItem ( const QIconSet & icon, const QString & text, const

368       QObject * receiver, const char * member, const QKeySequence & accel =
369       0, int id = -1, int index = -1 )
370       This is an overloaded member function, provided for convenience. It
371       behaves essentially like the above function.
372
373       Inserts a menu item with icon icon, text text, accelerator accel,
374       optional id id, and optional index position. The menu item is connected
375       it to the receiver's member slot. The icon will be displayed to the
376       left of the text in the item.
377
378       Returns the allocated menu identifier number (id if id >= 0).
379
380       See also removeItem(), changeItem(), setAccel(), connectItem(), QAccel,
381       and qnamespace.h.
382

int QMenuData::insertItem ( const QPixmap & pixmap, const QObject * receiver,

384       const char * member, const QKeySequence & accel = 0, int id = -1, int
385       index = -1 )
386       This is an overloaded member function, provided for convenience. It
387       behaves essentially like the above function.
388
389       Inserts a menu item with pixmap pixmap, accelerator accel, optional id
390       id, and optional index position. The menu item is connected it to the
391       receiver's member slot. The icon will be displayed to the left of the
392       text in the item.
393
394       To look best when being highlighted as a menu item, the pixmap should
395       provide a mask (see QPixmap::mask()).
396
397       Returns the allocated menu identifier number (id if id >= 0).
398
399       See also removeItem(), changeItem(), setAccel(), and connectItem().
400

int QMenuData::insertItem ( const QIconSet & icon, const QPixmap & pixmap,

402       const QObject * receiver, const char * member, const QKeySequence &
403       accel = 0, int id = -1, int index = -1 )
404       This is an overloaded member function, provided for convenience. It
405       behaves essentially like the above function.
406
407       Inserts a menu item with icon icon, pixmap pixmap, accelerator accel,
408       optional id id, and optional index position. The icon will be displayed
409       to the left of the pixmap in the item. The item is connected to the
410       member slot in the receiver object.
411
412       To look best when being highlighted as a menu item, the pixmap should
413       provide a mask (see QPixmap::mask()).
414
415       Returns the allocated menu identifier number (id if id >= 0).
416
417       See also removeItem(), changeItem(), setAccel(), connectItem(), QAccel,
418       and qnamespace.h.
419

int QMenuData::insertItem ( const QString & text, int id = -1, int index = -1

421       )
422       This is an overloaded member function, provided for convenience. It
423       behaves essentially like the above function.
424
425       Inserts a menu item with text text, optional id id, and optional index
426       position.
427
428       Returns the allocated menu identifier number (id if id >= 0).
429
430       See also removeItem(), changeItem(), setAccel(), and connectItem().
431

int QMenuData::insertItem ( const QIconSet & icon, const QString & text, int

433       id = -1, int index = -1 )
434       This is an overloaded member function, provided for convenience. It
435       behaves essentially like the above function.
436
437       Inserts a menu item with icon icon, text text, optional id id, and
438       optional index position. The icon will be displayed to the left of the
439       text in the item.
440
441       Returns the allocated menu identifier number (id if id >= 0).
442
443       See also removeItem(), changeItem(), setAccel(), and connectItem().
444

int QMenuData::insertItem ( const QString & text, QPopupMenu * popup, int id =

446       -1, int index = -1 )
447       This is an overloaded member function, provided for convenience. It
448       behaves essentially like the above function.
449
450       Inserts a menu item with text text, submenu popup, optional id id, and
451       optional index position.
452
453       The popup must be deleted by the programmer or by its parent widget. It
454       is not deleted when this menu item is removed or when the menu is
455       deleted.
456
457       Returns the allocated menu identifier number (id if id >= 0).
458
459       See also removeItem(), changeItem(), setAccel(), and connectItem().
460

int QMenuData::insertItem ( const QIconSet & icon, const QString & text,

462       QPopupMenu * popup, int id = -1, int index = -1 )
463       This is an overloaded member function, provided for convenience. It
464       behaves essentially like the above function.
465
466       Inserts a menu item with icon icon, text text, submenu popup, optional
467       id id, and optional index position. The icon will be displayed to the
468       left of the text in the item.
469
470       The popup must be deleted by the programmer or by its parent widget. It
471       is not deleted when this menu item is removed or when the menu is
472       deleted.
473
474       Returns the allocated menu identifier number (id if id >= 0).
475
476       See also removeItem(), changeItem(), setAccel(), and connectItem().
477

int QMenuData::insertItem ( const QPixmap & pixmap, int id = -1, int index =

479       -1 )
480       This is an overloaded member function, provided for convenience. It
481       behaves essentially like the above function.
482
483       Inserts a menu item with pixmap pixmap, optional id id, and optional
484       index position.
485
486       To look best when being highlighted as a menu item, the pixmap should
487       provide a mask (see QPixmap::mask()).
488
489       Returns the allocated menu identifier number (id if id >= 0).
490
491       See also removeItem(), changeItem(), setAccel(), and connectItem().
492

int QMenuData::insertItem ( const QIconSet & icon, const QPixmap & pixmap, int

494       id = -1, int index = -1 )
495       This is an overloaded member function, provided for convenience. It
496       behaves essentially like the above function.
497
498       Inserts a menu item with icon icon, pixmap pixmap, optional id id, and
499       optional index position. The icon will be displayed to the left of the
500       pixmap in the item.
501
502       Returns the allocated menu identifier number (id if id >= 0).
503
504       See also removeItem(), changeItem(), setAccel(), and connectItem().
505

int QMenuData::insertItem ( const QPixmap & pixmap, QPopupMenu * popup, int id

507       = -1, int index = -1 )
508       This is an overloaded member function, provided for convenience. It
509       behaves essentially like the above function.
510
511       Inserts a menu item with pixmap pixmap, submenu popup, optional id id,
512       and optional index position.
513
514       The popup must be deleted by the programmer or by its parent widget. It
515       is not deleted when this menu item is removed or when the menu is
516       deleted.
517
518       Returns the allocated menu identifier number (id if id >= 0).
519
520       See also removeItem(), changeItem(), setAccel(), and connectItem().
521

int QMenuData::insertItem ( const QIconSet & icon, const QPixmap & pixmap,

523       QPopupMenu * popup, int id = -1, int index = -1 )
524       This is an overloaded member function, provided for convenience. It
525       behaves essentially like the above function.
526
527       Inserts a menu item with icon icon, pixmap pixmap submenu popup,
528       optional id id, and optional index position. The icon will be displayed
529       to the left of the pixmap in the item.
530
531       The popup must be deleted by the programmer or by its parent widget. It
532       is not deleted when this menu item is removed or when the menu is
533       deleted.
534
535       Returns the allocated menu identifier number (id if id >= 0).
536
537       See also removeItem(), changeItem(), setAccel(), and connectItem().
538

int QMenuData::insertItem ( QWidget * widget, int id = -1, int index = -1 )

540       This is an overloaded member function, provided for convenience. It
541       behaves essentially like the above function.
542
543       Inserts a menu item that consists of the widget widget with optional id
544       id, and optional index position.
545
546       Ownership of widget is transferred to the popup menu or to the menu
547       bar.
548
549       Theoretically, any widget can be inserted into a popup menu. In
550       practice, this only makes sense with certain widgets.
551
552       If a widget is not focus-enabled (see QWidget::isFocusEnabled()), the
553       menu treats it as a separator; this means that the item is not
554       selectable and will never get focus. In this way you can, for example,
555       simply insert a QLabel if you need a popup menu with a title.
556
557       If the widget is focus-enabled it will get focus when the user
558       traverses the popup menu with the arrow keys. If the widget does not
559       accept ArrowUp and ArrowDown in its key event handler, the focus will
560       move back to the menu when the respective arrow key is hit one more
561       time. This works with a QLineEdit, for example. If the widget accepts
562       the arrow key itself, it must also provide the possibility to put the
563       focus back on the menu again by calling QWidget::focusNextPrevChild().
564       Futhermore, if the embedded widget closes the menu when the user made a
565       selection, this can be done safely by calling:
566
567               if ( isVisible() &&
568                    parentWidget() &&
569                    parentWidget()->inherits("QPopupMenu") )
570                   parentWidget()->close();
571
572       Returns the allocated menu identifier number (id if id >= 0).
573
574       See also removeItem().
575

int QMenuData::insertItem ( const QIconSet & icon, QCustomMenuItem * custom,

577       int id = -1, int index = -1 )
578       This is an overloaded member function, provided for convenience. It
579       behaves essentially like the above function.
580
581       Inserts a custom menu item custom with an icon and with optional id id,
582       and optional index position.
583
584       This only works with popup menus. It is not supported for menu bars.
585       Ownership of custom is transferred to the popup menu.
586
587       If you want to connect a custom item to a slot, use connectItem().
588
589       Returns the allocated menu identifier number (id if id >= 0).
590
591       See also connectItem(), removeItem(), and QCustomMenuItem.
592

int QMenuData::insertItem ( QCustomMenuItem * custom, int id = -1, int index =

594       -1 )
595       This is an overloaded member function, provided for convenience. It
596       behaves essentially like the above function.
597
598       Inserts a custom menu item custom with optional id id, and optional
599       index position.
600
601       This only works with popup menus. It is not supported for menu bars.
602       Ownership of custom is transferred to the popup menu.
603
604       If you want to connect a custom item to a slot, use connectItem().
605
606       Returns the allocated menu identifier number (id if id >= 0).
607
608       See also connectItem(), removeItem(), and QCustomMenuItem.
609

int QMenuData::insertSeparator ( int index = -1 )

611       Inserts a separator at position index, and returns the menu identifier
612       number allocated to it. The separator becomes the last menu item if
613       index is negative.
614
615       In a popup menu a separator is rendered as a horizontal line. In a
616       Motif menu bar a separator is spacing, so the rest of the items
617       (normally just "Help") are drawn right-justified. In a Windows menu bar
618       separators are ignored (to comply with the Windows style guidelines).
619
620       Examples:
621

bool QMenuData::isItemActive ( int id ) const

623       Returns TRUE if the menu item with the id id is currently active;
624       otherwise returns FALSE.
625

bool QMenuData::isItemChecked ( int id ) const

627       Returns TRUE if the menu item with the id id has been checked;
628       otherwise returns FALSE.
629
630       See also setItemChecked().
631
632       Examples:
633

bool QMenuData::isItemEnabled ( int id ) const

635       Returns TRUE if the item with identifier id is enabled; otherwise
636       returns FALSE
637
638       See also setItemEnabled() and isItemVisible().
639

bool QMenuData::isItemVisible ( int id ) const

641       Returns TRUE if the menu item with the id id is visible; otherwise
642       returns FALSE.
643
644       See also setItemVisible().
645

int QMenuData::itemParameter ( int id ) const

647       Returns the parameter of the activation signal of item id.
648
649       If no parameter has been specified for this item with
650       setItemParameter(), the value defaults to id.
651
652       See also connectItem(), disconnectItem(), and setItemParameter().
653

void QMenuData::menuContentsChanged () [virtual protected]

655       Virtual function; notifies subclasses that one or more items have been
656       inserted or removed.
657
658       Reimplemented in QMenuBar.
659

void QMenuData::menuDelPopup ( QPopupMenu * ) [virtual protected]

661       Virtual function; notifies subclasses that a popup menu item has been
662       removed.
663

void QMenuData::menuInsPopup ( QPopupMenu * ) [virtual protected]

665       Virtual function; notifies subclasses that a popup menu item has been
666       inserted.
667

void QMenuData::menuStateChanged () [virtual protected]

669       Virtual function; notifies subclasses that one or more items have
670       changed state (enabled/disabled or checked/unchecked).
671
672       Reimplemented in QMenuBar.
673

QPixmap * QMenuData::pixmap ( int id ) const

675       Returns the pixmap that has been set for menu item id, or 0 if no
676       pixmap has been set.
677
678       See also changeItem(), text(), and iconSet().
679

void QMenuData::removeItem ( int id )

681       Removes the menu item that has the identifier id.
682
683       See also removeItemAt() and clear().
684
685       Example: chart/chartform.cpp.
686

void QMenuData::removeItemAt ( int index )

688       Removes the menu item at position index.
689
690       See also removeItem() and clear().
691

void QMenuData::setAccel ( const QKeySequence & key, int id )

693       Sets the accelerator key for the menu item id to key.
694
695       An accelerator key consists of a key code and a combination of the
696       modifiers SHIFT, CTRL, ALT or UNICODE_ACCEL (OR'ed or added). The
697       header file qnamespace.h contains a list of key codes.
698
699       Defining an accelerator key produces a text that is added to the menu
700       item; for instance, CTRL + Key_O produces "Ctrl+O". The text is
701       formatted differently for different platforms.
702
703       Note that keyboard accelerators in Qt are not application-global,
704       instead they are bound to a certain top-level window. For example,
705       accelerators in QPopupMenu items only work for menus that are
706       associated with a certain window. This is true for popup menus that
707       live in a menu bar since their accelerators will then be installed in
708       the menu bar itself. This also applies to stand-alone popup menus that
709       have a top-level widget in their parentWidget() chain. The menu will
710       then install its accelerator object on that top-level widget. For all
711       other cases use an independent QAccel object.
712
713       Example:
714
715               QMenuBar *mainMenu = new QMenuBar;
716               QPopupMenu *fileMenu = new QPopupMenu;       // file sub menu
717               fileMenu->insertItem( "Open Document", 67 ); // add "Open" item
718               fileMenu->setAccel( CTRL + Key_O, 67 );      // Ctrl+O to open
719               fileMenu->insertItem( "Quit", 69 );          // add "Quit" item
720               fileMenu->setAccel( CTRL + ALT + Key_Delete, 69 ); // add Alt+Del to quit
721               mainMenu->insertItem( "File", fileMenu );    // add the file menu
722
723       If you need to translate accelerators, use tr() with a string:
724
725               fileMenu->setAccel( tr("Ctrl+O"), 67 );
726
727       You can also specify the accelerator in the insertItem() function. You
728       may prefer to use QAction to associate accelerators with menu items.
729
730       See also accel(), insertItem(), QAccel, and QAction.
731
732       Example: menu/menu.cpp.
733

void QMenuData::setId ( int index, int id ) [virtual]

735       Sets the menu identifier of the item at index to id.
736
737       If index is out of range, the operation is ignored.
738
739       See also idAt().
740

void QMenuData::setItemChecked ( int id, bool check )

742       If check is TRUE, checks the menu item with id id; otherwise unchecks
743       the menu item with id id. Calls QPopupMenu::setCheckable( TRUE ) if
744       necessary.
745
746       See also isItemChecked().
747
748       Examples:
749

void QMenuData::setItemEnabled ( int id, bool enable )

751       If enable is TRUE, enables the menu item with identifier id; otherwise
752       disables the menu item with identifier id.
753
754       See also isItemEnabled().
755
756       Examples:
757

bool QMenuData::setItemParameter ( int id, int param )

759       Sets the parameter of the activation signal of item id to param.
760
761       If any receiver takes an integer parameter, this value is passed.
762
763       See also connectItem(), disconnectItem(), and itemParameter().
764
765       Example: mdi/application.cpp.
766

void QMenuData::setItemVisible ( int id, bool visible )

768       If visible is TRUE, shows the menu item with id id; otherwise hides the
769       menu item with id id.
770
771       See also isItemVisible() and isItemEnabled().
772

void QMenuData::setWhatsThis ( int id, const QString & text )

774       Sets text as What's This help for the menu item with identifier id.
775
776       See also whatsThis().
777
778       Examples:
779

QString QMenuData::text ( int id ) const

781       Returns the text that has been set for menu item id, or QString::null
782       if no text has been set.
783
784       See also changeItem(), pixmap(), and iconSet().
785
786       Examples:
787

void QMenuData::updateItem ( int id ) [virtual]

789       Virtual function; notifies subclasses about an item with id that has
790       been changed.
791
792       Reimplemented in QPopupMenu.
793

QString QMenuData::whatsThis ( int id ) const

795       Returns the What's This help text for the item with identifier id or
796       QString::null if no text has yet been defined.
797
798       See also setWhatsThis().
799
800

SEE ALSO

802       http://doc.trolltech.com/qmenudata.html
803       http://www.trolltech.com/faq/tech.html
804
806       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
807       license file included in the distribution for a complete license
808       statement.
809

AUTHOR

811       Generated automatically from the source code.
812

BUGS

814       If you find a bug in Qt, please report it as described in
815       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
816       help you. Thank you.
817
818       The definitive Qt documentation is provided in HTML format; it is
819       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
820       web browser. This man page is provided as a convenience for those users
821       who prefer man pages, although this format is not officially supported
822       by Trolltech.
823
824       If you find errors in this manual page, please report them to qt-
825       bugs@trolltech.com.  Please include the name of the manual page
826       (qmenudata.3qt) and the Qt version (3.3.8).
827
828
829
830Trolltech AS                    2 February 2007                 QMenuData(3qt)
Impressum