How to Add Options Menu in Symbian Application

From Qt Wiki
Revision as of 15:40, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

English Български

How to Add Options Menu in Symbian Application

Options menu and Exit button can be attached to QMainWindow [doc.qt.nokia.com], QDialog [doc.qt.nokia.com] or to QWidget [doc.qt.nokia.com] on Symbian. QMainWindow has predefined Symbian CBA buttons but they have to be defined for QDialog and QWidget.

Preconditions

Make sure that the status pane and the control pane of the application are enabled. To do it call method showMaximized() of the main window:

Defining menus in QMainWindow

QMainWindow has predefined Symbian CBA buttons so different options can be added to the Options menu by adding a new action.

Please note that exampleSlot() slot is called when an item is selected from the Options menu and its behavior should be also implemented.

Defining menus in QDialog or QWidget

Symbian CBA buttons are not predefined for QDialog or QWidget and they have to be defined.

An instance of QMenu [doc.qt.nokia.com] should be added at the header:

At appropriate location should be added the implementation of Options menu and the Exit button:

Of course the right button can be used not only to close the application as it can be connected to other slot.

See also

Remove actions option menu in Symbian [developer.qt.nokia.com]

References

Forum Nokia: Adding Options menu, panes and icon to a Qt for Symbian application [wiki.forum.nokia.com]

Categories: