Loading...
Searching...
No Matches
MenuBuilder Class Reference
Inheritance diagram for MenuBuilder:

## Public Member Functions

void | addAction (const QStringList &path, QAction *action, int priority=-1)
void | removeAction (QAction *action)
void | buildMenuBar (QMenuBar *menuBar)
void | buildMenu (QMenu *menu, const QString &path)
void | print ()
const QMap< QString, QList< QAction * > > & | getMenuActions () const

## Member Function Documentation

## addAction()

void addAction | ( | const QStringList & | path,
|  | QAction * | action,
|  | int | priority = -1 )

Add a new action to the menu builder object.

Parameters

  path | The menu path, where each element specifies a menu level.
  action | The action that will be added at the path.
  priority | The priority of the entry, higher will be at the top.

## removeAction()

void removeAction | ( | QAction * | action | ) |

Remove an action from the menu builder. Safe to call with a partially-destroyed QAction (pointer used as key only).

## buildMenuBar()

void buildMenuBar | ( | QMenuBar * | menuBar | ) |

Populate the supplied menu bar with the items added to builder. Ordering is attempted, ensuring File is first, Help is last and ordering by priority and then alphanumerically.

Parameters

  menu | The menu to be populated.

## buildMenu()

void buildMenu | ( | QMenu * | menu,
|  | const QString & | path )

Populate a menu with the appropriate sub-entries.

## print()

void print | ( |  | ) |

Print the contents of the MenuBuilder, intended for debug.

## getMenuActions()

const QMap< QString, QList< QAction * > > & getMenuActions | ( |  | ) | const

Get the map of string to action lists.