Adding a new menu

Das KDevelop-Programmierhandbuch: Leitfaden zur C++-Anwendungsentwicklung für das K Desktop Environment (KDE) mit Hilfe der KDevelop-IDE in der Version 1.2
Zurück | Kapitel 5. Configuring Menubars and Toolbars | Vor

# 5.2. Adding a new menu

A new menubar is added to an application by the following:

1. add a pointer to the new menu in the App-class header

2. call the constructor of `QPopupMenu` to the pointer in `initMenuBar()` at the location where your menubar should appear later.

3. insert the according menu-items into the popup menu and set their resource ID's in the resource file

4. add connects for `commandCallback()` and `statusCallback()` to the menu at the end of `initMenuBar()`

5. add the methods you want to call by the menu-entries in the header and implementation file.

6. add the switch statements for the entries to the `commandCallback()` and `statusCallback()` methods

Zurück | Anfang | Vor
Configuring Menubars and Toolbars | Hoch | Integrating Toolbar buttons